TECHNOLOGY

Aborting an S3 multipart upload can race with in-flight parts

In this article
THE QUICK TAKE

Quiesce the uploader and verify the documented cleanup outcome; abort acknowledgement alone does not account for every in-flight part.

The cleanup response precedes the last worker

A checkpoint uploader fails and its coordinator aborts the multipart upload. Some workers had already started sending parts. A successful abort response does not establish that every concurrent part has finished or that all temporary storage has already been reconciled.

The AbortMultipartUpload API explicitly states that in-progress parts may or may not succeed and that repeated aborts can be necessary to free all part storage. This is a documented race, not evidence that abort was ignored.

Preserve upload identity and worker state

Record bucket, key and upload ID with the failed publication attempt. Different multipart attempts for the same key are separate objects of cleanup. Do not choose a target solely from the current application filename or a recent error message lacking upload identity.

Stop or fence the failed attempt’s workers so they do not continue submitting work or initiate a replacement under an ambiguous coordinator record. Preserve already-issued requests and their outcomes. Local task cancellation does not prove that remote work stopped before the abort.

Separate temporary parts from a completed object

Abort concerns the incomplete upload identified by its upload ID. It is not deletion of a separately completed object version. If completion itself was uncertain, inspect publication state through the appropriate object/version mechanism rather than assuming part cleanup decided whether the checkpoint exists.

This distinction prevents an aggressive cleanup process from treating a valid completed checkpoint as abandoned data. The failed attempt, any replacement attempt and the selected durable version should remain separately identifiable throughout reconciliation.

Verify the remaining parts

The ListParts reference describes upload-specific listing and pagination. Preserve truncation and continuation markers when collecting a nonempty part inventory. A first page cannot account for every uploaded part when further pages remain.

The abort reference recommends verifying that the parts list is empty. Follow the deployed service and SDK’s documented post-abort outcomes, retaining errors distinctly from an empty successful listing. Permission failure or an incorrectly selected upload is not affirmative evidence of cleanup.

Acceptance for reclamation

Accept cleanup when the original workers are quiescent, the correct upload attempt has reached the documented terminal outcome and no unresolved part inventory remains. If in-flight operations produce additional retained parts, repeat the supported reconciliation within a bounded cleanup process rather than blindly issuing abort forever.

Multipart publication explains the separate completion boundary. Object version identity explains how to preserve any completed checkpoint while temporary upload state is reconciled.

Limits of a cleanup certificate

Part reclamation does not certify application data consistency or establish that a replacement upload completed. It also does not measure exact storage-charge timing. Preserve the observed cleanup outcome and unresolved exceptions without inferring more from one acknowledgement. The practical result is ownership-aware reconciliation of a failed upload, including work that was already in flight when the coordinator decided to stop.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles