[AWSSDK.Extensions.NETCore.Setup] ClientFactory incorrectly triggers RegionEndpoint fallback location mechanism which is very slow #3588
Labels
bug
This issue is a bug.
closing-soon
This issue will automatically close in 4 days unless further comments are made.
module/tools
p2
This is a standard priority issue
Describe the bug
When I'm using this library on dev machine and the library tries to access EC2 metadata on every restart of the app that's very slow and annoying.
After some digging I have found that the problem is in
ClientFactory.CreateConfig(...)
. Specifically, this code tries to avoid the issue above:But a few lines below there is check related to
RetryMode
which accessesconfig.DefaultConfigurationMode
whendefaultConfig.RetryMode
isLegacy
(the default). The access ofDefaultConfigurationMode
triggers the access ofRegionEndpoint
internally, which this code tries to avoid in the first place.Regression Issue
Expected Behavior
The initialization of service client is fast on dev machine
Current Behavior
The initialization of service client is slow on dev machine because it is trying to incorrectly access EC2 metadata
Reproduction Steps
appsettings.json
Asp.Net core app initialized from default template:
Possible Solution
No response
Additional Information/Context
No response
AWS .NET SDK and/or Package version used
AWSSDK.Extensions.NETCore.Setup 3.7.301
AWSSDK.CloudFormation 3.7.401.12
Targeted .NET Platform
.NET 9
Operating System and version
Windows 10
The text was updated successfully, but these errors were encountered: