fix(s3): keep multipart upload ID when abort after failed completion fails - #949
Closed
mayuriphad wants to merge 1 commit into
Closed
mayuriphad wants to merge 1 commit into
mayuriphad wants to merge 1 commit into
Conversation
…fails When CompleteMultipartUpload failed and the abort also failed, S3File.commit() cleared the upload ID, so a later discard() had nothing to abort and the incomplete upload stayed in S3 accruing storage cost. The helper now marks the exception when the abort fails, and commit() keeps the upload ID in that case so discard() can retry the abort. Refs pyathena-dev#945
This was referenced Oct 3, 2026
Merged
Member
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.
Refs #945.
WHAT
\S3File.commit()\ now keeps \multipart_upload\ and the part futures when the abort that follows a failed \CompleteMultipartUpload\ also fails. A successful abort still clears them, as before.
WHY
If the abort fails, the upload still exists. Clearing the upload ID meant a later \discard()\ (for example, a transaction rollback) had nothing to abort, so the incomplete upload kept accruing storage cost until a lifecycle rule removed it.
Implementation: _finish_multipart_upload()\ marks the exception it re-raises (\multipart_abort_failed) only when its abort fails. \commit()\ clears the upload state unless that marker is set.
TEST
uff check\ and
uff format --check\ pass on the changed files.