Fix intermittent SSL connection issues with retry logic #2
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.
Fix Intermittent SSL Connection Issues with Intuit API
Summary
Implemented retry logic with exponential backoff to handle intermittent SSL connection errors when fetching the OpenID Connect discovery document from
https://developer.intuit.com/.well-known/openid_configuration/. The solution adds retry capability specifically forSSLErrorandConnectionErrorexceptions while preserving backward compatibility and existing behavior for all other error types.Key Changes:
get_discovery_doc()inintuitlib/utils.pyto retry SSL and connection errors up to 3 times with exponential backoff (1s, 2s delays)requests.exceptions.SSLErrorandrequests.exceptions.ConnectionErrortrigger retries - all other exceptions (HTTP errors, timeouts, etc.) maintain existing behaviorReview & Testing Checklist for Human
requests.Sessionobjects still works correctly after the changesNotes