Synchronization in AmazonS3Client::fetchRegionFromCache method
Describe the bug
There are cases when lots of threads are trying to execute invoke() method. E.g: big data use case, where multiple threads query S3 for listing operation.
In such cases, "fetchRegionFromCache" gets executed multiple times causing additional HEAD requests and delays.
It would be good to mark "AmazonS3Client::fetchRegionFromCache" as synchornized to avoid unwanted HEAD requests.
This would help in improving performance of listing with multiple threads in client side.
Your Environment
aws-java-sdk-bundle-1.11.563.jar OpenJDK 1.8.0_262
Hi @rbalamohan we always want to be cautious when changing a sensitive part of the code such as the S3Client.
Can you provide benchmarks showing the improvement of the change you're proposing?
And also, since it's an improvement, I'm changing this to a feature request.
This is a very old issue that is probably not getting as much attention as it deserves. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to provide a comment or open a new issue.