Skip to content

fix(uploads): prevent ready assets starving expired cleanup - #588

Merged
bytemain merged 1 commit into
mainfrom
volta/upload-cleanup-starvation
Oct 1, 2026
Merged

bytemain merged 1 commit into
mainfrom
volta/upload-cleanup-starvation

Conversation

@bytemain

@bytemain bytemain commented Oct 1, 2026

Copy link
Copy Markdown
Member

Expired uploads can remain stuck forever when the cleanup query's oldest 50 rows are completed assets. The cron selects those ready rows every time, then the cleanup claim rejects them, so newer expired uploads never enter a batch.

Exclude ready uploads from the expired/live selection before ordering and limiting. Completed assets retain their database records and R2 objects. Existing tombstone retries and active-verifier fences stay in place.

Production read-only diagnosis: the deployed query's first batch contained 50 ready rows; there were 1,099 expired ready/live rows, and the reported asset remained verifying after its upload deadline. No production state was changed.

Validation: regression cases for both expired pending and verifying uploads behind 50 completed assets fail before the fix, then pass. They verify removal of the expired asset and replay, preservation of all 50 final objects, and redeclaration in the same build with a new asset id. All 31 upload route tests pass; diff check passes. Deployment is separate from this PR.

Signed-off-by: Volta <volta@mail.build>
@bytemain
bytemain merged commit ff63508 into main Oct 1, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant