Akshat-Jain commented on code in PR #16438:
URL: https://github.com/apache/druid/pull/16438#discussion_r1598200444
##########
extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/ServerSideEncryptingAmazonS3.java:
##########
@@ -204,7 +205,19 @@ public ServerSideEncryptingAmazonS3 build()
throw new ISE("S3StorageConfig cannot be null!");
}
- return new ServerSideEncryptingAmazonS3(amazonS3ClientBuilder.build(),
s3StorageConfig.getServerSideEncryption());
+ AmazonS3 amazonS3Client;
+ try {
+ amazonS3Client = RetryUtils.retry(
+ () -> amazonS3ClientBuilder.build(),
+ (e) -> true,
+ RetryUtils.DEFAULT_MAX_TRIES
+ );
+ }
+ catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+
+ return new ServerSideEncryptingAmazonS3(amazonS3Client,
s3StorageConfig.getServerSideEncryption());
Review Comment:
Had some questions here regarding `(e) -> true` part. I noticed that we use
`(e) -> true` predicate at a couple other places. So I wanted to check if this
is okay, as there can be multiple other implementation approaches here.
Possible approaches:
1. Keep it as is.
2. Create another predicate like `S3Utils.S3RETRY`, with the condition
`e.getMessage().contains("Unable to find a region via the region provider
chain")`, and use that. Reason for a different predicate is that S3RETRY's
javadoc suggest that it's supposed to be used for I/O operations only.
3. Update S3RETRY predicate itself to handle `Unable to find a region via
the region provider chain` message, and update javadoc to mark it non-I/O
specific.
cc: @cryptoe @kfaraz Thoughts?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]