AWS: Call abortUpload only once when any of the completable future fails #5366
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.
About the Change :
Presently whenever a failure is observed in any of the completableFutures in
uploadParts(), it causes further completable futures fail withFileNotFoundException, when it tries to create a request for it usingRequestBody.fromFile(file), as all the stagings files deleted as part ofabortUploadwhich is called on failure of first completableFuture.iceberg/aws/src/main/java/org/apache/iceberg/aws/s3/S3OutputStream.java
Line 306 in 7a92bf5
I think this is what was also highlighted in @stevenzwu 's observation here (#4168 (comment))
This change attempts :
completableFutureswhich fail due to fileNotFoundException.Testing Done
Existing UT's + a UT to see abort is called only once rather than atleast once.
cc @rdblue @jackye1995 @RussellSpitzer @stevenzwu @amogh-jahagirdar @rajarshisarkar