aws-sdk-java icon indicating copy to clipboard operation
aws-sdk-java copied to clipboard

Synchronization in AmazonS3Client::fetchRegionFromCache method

Open rbalamohan opened this issue 4 years ago • 2 comments

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

rbalamohan avatar Jan 18 '21 23:01 rbalamohan

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?

debora-ito avatar Jan 21 '21 00:01 debora-ito

And also, since it's an improvement, I'm changing this to a feature request.

debora-ito avatar Jan 21 '21 00:01 debora-ito

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.

github-actions[bot] avatar Jan 28 '24 03:01 github-actions[bot]