Ignore abort-on-cleanup failure in S3 repo#138569
Merged
DaveCTurner merged 2 commits intoelastic:mainfrom Nov 25, 2025
Merged
Conversation
If a `CompleteMultipartUpload` request fails then we attempt to clean up by calling the `AbortMultipartUpload` API. This cleanup may also fail, and a failure here will supersede the original failure. The cleanup is really a best-effort thing so we should ignore failures. In particular if the `CompleteMultipartUpload` has an `If-None-Match` precondition then this may fail with a `409 Conflict` and in that case the upload no longer exists, so we would expect the `AbortMultipartUpload` call to fail with a 404. This commit extends `S3HttpHandler` to respond with both 412 and 409s on precondition failures, cleaning up the upload on a 409 but not a 412, triggering the unwanted failure path in some tests, and adds exception handling to deal with it.
Collaborator
|
Hi @DaveCTurner, I've created a changelog YAML for you. |
Collaborator
|
Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination) |
Contributor
|
Hey, this change partially includes changes from #138542. Is it to be merged first or second? |
Contributor
Author
|
This one goes in first, fixing the missing exception handling, then #138542 will just be about adding the |
ncordon
pushed a commit
to ncordon/elasticsearch
that referenced
this pull request
Nov 26, 2025
If a `CompleteMultipartUpload` request fails then we attempt to clean up by calling the `AbortMultipartUpload` API. This cleanup may also fail, and a failure here will supersede the original failure. The cleanup is really a best-effort thing so we should ignore failures. In particular if the `CompleteMultipartUpload` has an `If-None-Match` precondition then this may fail with a `409 Conflict` and in that case the upload no longer exists, so we would expect the `AbortMultipartUpload` call to fail with a 404. This commit extends `S3HttpHandler` to respond with both 412 and 409s on precondition failures, cleaning up the upload on a 409 but not a 412, triggering the unwanted failure path in some tests, and adds exception handling to deal with it.
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.
If a
CompleteMultipartUploadrequest fails then we attempt to clean upby calling the
AbortMultipartUploadAPI. This cleanup may also fail,and a failure here will supersede the original failure. The cleanup is
really a best-effort thing so we should ignore failures. In particular
if the
CompleteMultipartUploadhas anIf-None-Matchpreconditionthen this may fail with a
409 Conflictand in that case the upload nolonger exists, so we would expect the
AbortMultipartUploadcall tofail with a 404.
This commit extends
S3HttpHandlerto respond with both 412 and 409s onprecondition failures, cleaning up the upload on a 409 but not a 412,
triggering the unwanted failure path in some tests, and adds exception
handling to deal with it.