Skip to content

Fix SdkPlugins being able to set a region, but the SdkClient's crashing without region anyways.#7177

Open
Techno3d wants to merge 5 commits into
aws:masterfrom
Techno3d:master
Open

Fix SdkPlugins being able to set a region, but the SdkClient's crashing without region anyways.#7177
Techno3d wants to merge 5 commits into
aws:masterfrom
Techno3d:master

Conversation

@Techno3d

Copy link
Copy Markdown

Motivation and Context

This is a fix for #7151. SdkPlugins were invoked after region resolution happened, which led to a bug where if the SdkPlugin was the only thing setting a region, the SdkClient would not build, instead throwing an SdkClientException due to not being able to resolve a region.

Modifications

This PR changes SdkDefaultClientBuilder so that SdkPlugins are invoked before the region is resolved, modifying syncClientConfiguration and asyncClientConfiguration.

Testing

I've added a test to SdkPluginTest that checks if the ProtocolRestJsonClient can be built and the region is set correctly. I did not add this test to the regular testCases list because the defaultClient sets a Region of US_WEST_2, and I could not uncouple that without tests breaking. I've also tested this on my own project that was using an SdkPlugin to set region (among other settings), and it now works without throwing a SdkClientException.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@Techno3d
Techno3d requested a review from a team as a code owner July 21, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant