Akshat-Jain commented on code in PR #16438:
URL: https://github.com/apache/druid/pull/16438#discussion_r1598625008
##########
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:
@abhishekrb19
> Also, could you elaborate on why we need this exception to be retriable -
"Unable to find a region via the region provider chain"?
There seem to be times where AWS SDK isn't able to obtain the credentials
for using some AWS service.
(https://github.com/aws/aws-sdk-java/issues/2285#issuecomment-613119333 and
https://medium.com/expedia-group-tech/service-slow-to-retrieve-aws-credentials-ebc02a38e95b).
Also, in my chat with Dhananjay and Andy, they mentioned that retries solve
this type of problem. Hence, the suggestion was to add retries since there's no
way to deterministically simulate it.
> Yeah, I don't think we want to retry unconditionally on all exceptions. If
an error is non-recoverable, we should fail fast instead of retrying.
Fair enough. Would you suggest going with approach (2)? Or approach (3)?
--
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]