fix: apply S3 service configurations to async S3 client (#14575) - #17549
Open
waterWang wants to merge 2 commits into
Open
fix: apply S3 service configurations to async S3 client (#14575)#17549waterWang wants to merge 2 commits into
waterWang wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Fixes S3 service configurations (pathStyleAccess, dualStack, crossRegionAccess, useArnRegion, accelerateMode, chunkedEncoding) not being applied to the non-CRT async S3 client.
Root cause
DefaultAwsClientFactory.s3Async()usedS3AsyncClient.builder()but never calledapplyServiceConfigurationson it. The syncs3()method did apply these settings, but the async path was missing the call.Changes
S3FileIOProperties.java: Changed
applyServiceConfigurationsgeneric bound from<T extends S3ClientBuilder>to<T extends S3BaseClientBuilder>—S3BaseClientBuilderis the common base for bothS3ClientBuilder(sync) andS3AsyncClientBuilder(async), and defines all the methods used (dualstackEnabled,crossRegionAccessEnabled,serviceConfiguration).AwsClientFactories.java: Added
.applyMutation(s3FileIOProperties::applyServiceConfigurations)to the non-CRTS3AsyncClient.builder()chain.Verification
applyServiceConfigurationsacceptsS3BaseClientBuilderwhich both sync and async builders extends3()method continues to callapplyServiceConfigurationsunchangedS3CrtAsyncClientBuilder) is unaffected — it uses a separate builder hierarchyCloses #14575