-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update S3 retry logic to account for the underlying cause in case of IOException
#15238
Conversation
…ption. 4xx and other errors wrapped in IOException for instance aren't retriable.
object0.setBucketName(bucket); | ||
object0.setKey(keyPrefix + "/renames-0.gz"); | ||
object0.getObjectMetadata().setLastModified(new Date(0)); | ||
object0.setObjectContent(new FileInputStream(tmpFile)); |
Check warning
Code scanning / CodeQL
Potential input resource leak
|
||
final File tmpFile = temporaryFolder.newFile("gzTest.gz"); | ||
|
||
try (OutputStream outputStream = new GZIPOutputStream(new FileOutputStream(tmpFile))) { |
Check warning
Code scanning / CodeQL
Potential output resource leak
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! 🙇🐻
…`IOException` (apache#15238) * Update S3 retry logic based on the underlying cause in case of IOException. 4xx and other errors wrapped in IOException for instance aren't retriable. * Fix CI
In some places we wrap
AmazonS3Exception
inside anIOException
and allIOException
s by default are retried by the S3 retry logic. For example, a 403AccessDenied
Se exception code wrapped insideIOException
shouldn't be retried.This PR updates the s3 retry logic to account for the underlying cause if it's found.
Release note
S3 exceptions like 403 AccessDenied codes wrapped inside other exceptions, like
IOException
, won't trigger unnecessary retries.Key changed/added classes in this PR
S3Utils.java
S3UtilsTest.java
S3DataSegmentPullerTest.java
This PR has: