Repository navigation
fix(cleanup): release generations whose multipart upload can't be aborted - #59
Merged
fengmk2 merged 2 commits intoNov 13, 2026
Merged
Conversation
…rted Publication left the upload ID of a completed multipart upload on the generation. When the generation expired, cleanup aborted that upload before it deleted the objects and the row, in one try block. R2 does not promise that a resumed upload still exists, so if the abort rejects, the row stays in 'deleting' with its charged bytes and is retried every 10 minutes forever. Enough such rows fill the shared byte budget and the 16-row cleanup batch for every namespace. Clear the upload ID when publication completes the upload, and treat a failed abort as non-fatal. The bucket lifecycle already aborts uploads left incomplete after one day. The second change also releases rows that were published before this fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fengmk2
marked this pull request as ready for review
November 13, 2026 06:13
fengmk2
commented
Nov 13, 2026
Review feedback: the catch also hid transient R2 failures for uploads that still hold parts. Cleanup then deleted the row and released its charge, so new stores could reuse that quota while the parts still used storage, and the upload ID needed for a retry was lost. Continue only when R2 reports NoSuchUpload (10024). Any other abort error keeps the generation, its charge, and its upload ID for the next cleanup run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Publication left the upload ID of a completed multipart upload (blobs over 5 MiB) on the generation. When the generation expired, cleanup aborted that upload before it deleted the R2 objects and the D1 row, all in one
try. R2 does not check that a resumed upload still exists, and its docs say callers must handle errors when the upload no longer exists. If the abort rejects, the row stays indeletingwith its charged bytes and is retried every 10 minutes forever. Enough such rows fill the deployment byte budget, which blocks stores in every namespace, and take over the 16-row cleanup batch.upload_idwhen it completes the upload.NoSuchUpload, code 10024). Any other error, such as a transient internal error, keeps the generation, its charge, and its upload ID for the next cleanup run.The second change also releases rows that were published before this fix and still carry an upload ID, if R2 answers 10024 for them.
🤖 Generated with Claude Code