Remove list_available_services from client creation happy path#3687
Remove list_available_services from client creation happy path#3687SamRemis wants to merge 4 commits intoboto:developfrom
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3687 +/- ##
===========================================
+ Coverage 92.59% 92.61% +0.01%
===========================================
Files 68 68
Lines 15634 15698 +64
===========================================
+ Hits 14477 14538 +61
- Misses 1157 1160 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jonathan343
left a comment
There was a problem hiding this comment.
One edge I think we're breaking with this:
We currently have logic that catches an UnknownServiceError exception thrown when we attempt to load service endpoints and partitions files. In this case, we will fallback to using legacy endpoints.
Problem: If a customer has custom models (pre-EP2.0 migration) and supplies a api_version parameter, we'll start throwing a DataNotFoundError which isn't caught and we'll start breaking customers for this scenario.
Lines 125 to 137 in 61b379e
Description of changes:
For all service creation, we have a cached
list_available_servicesmethod that we call, but the output is only used if we encounter an error during client creation. This iterates through multiple directories to get all available service names, including the botocore/data directory with 424 seconds.This PR removes the call to this method if the service is able to be found. Removing this step removes an average of 45.5ms for successful s3 client creation when run locally on my machine. The performance improvement of this will vary between machines.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.