Report endpoint_payload.dropped when the orchestrator removes a stored payload#273
Merged
Merged
Conversation
…d payload `FilesOrchestrator` silently deletes stored batches that are never uploaded — too old (`maxFileAgeForRead`) or purged to keep the directory under `maxDirectorySize`. Add an `onDrop` callback (invoked with the file's byte size, outside the state lock) wired to `UploadObserver.uploadDropped`, so those removals are counted as `endpoint_payload.dropped`. Successful upload deletions (`delete(readableFile:)`) are not reported. Wired for spans and coverage. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ypopovych
force-pushed
the
yehor.popovych/sdtest-3777-endpoint-dropped
branch
from
June 3, 2026 14:56
9bc64a2 to
dc34f38
Compare
anmarchenko
approved these changes
Jun 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
First slice of SDTEST-3777 — wires the producer side of
endpoint_payload.dropped. The consumer side (onDropped → endpoint_payload.dropped.add(endpoint:)) was already added in #272; this connects it to where payloads are actually discarded.Why
FilesOrchestratorsilently deletes stored batches that are never uploaded:maxFileAgeForRead(during read scans and directory purge), andmaxDirectorySize.Neither was observable. Both are exactly what
endpoint_payload.dropped("payloads dropped after all retries") is meant to count.How
FilesOrchestratorgains anonDrop: (@Sendable (Int) -> Void)?callback, invoked with the dropped file's byte size outside the state lock (so the observer can't contend with file ops). Age-purge drops are collected infileInfosand reported bygetReadableFile/getAllReadableFilesafter the lock; size-purge drops are reported directly inpurgeFilesDirectoryIfNeeded.delete(readableFile:)) are not reported.test_cycle) and coverage (code_coverage) viaobservers.upload.uploadDropped.Testing
testGivenFileTooOld_whenScanned_itReportsDropWithSize— too-old file reports a drop with its size.testGivenSuccessfulRead_whenDeleted_itDoesNotReportDrop— marked-as-read deletions are not drops.Architecture doc updated (moves
endpoint_payload.droppedfrom TODO to gathered).🤖 Generated with Claude Code