Repository navigation
Fix intermittent SSL connection issues with retry logic - #2
Open
devin-ai-integration[bot] wants to merge 3 commits into
Open
devin-ai-integration[bot] wants to merge 3 commits into
devin-ai-integration[bot] wants to merge 3 commits into
Conversation
- Add retry logic with exponential backoff to get_discovery_doc() function - Handle SSLError, SSLEOFError, and ConnectionError exceptions - Implement 3 retries with backoff factor of 1 (1s, 2s delays) - Maintain backward compatibility with existing functionality - Add comprehensive test script to verify retry behavior - Preserve existing HTTP error handling (no retries for HTTP errors) Fixes intermittent SSL errors when fetching OpenID Connect discovery document from https://developer.intuit.com/.well-known/openid_configuration/ Co-Authored-By: abhay.aggarwal@codeium.com <abhay.aggarwal@windsurf.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Owner
|
Add more robust testing |
- Added 7 new test methods to tests/test_utils.py covering all retry scenarios - Test SSL error retry with exponential backoff timing verification - Test connection error retry and retry exhaustion scenarios - Test session-based retry logic and mixed error types - Verify HTTP errors don't trigger retries (preserve existing behavior) - Test normal operation timing to ensure no artificial delays - Removed standalone test_ssl_retry.py script (functionality integrated) Addresses GitHub PR feedback requesting 'more robust testing' Co-Authored-By: abhay.aggarwal@codeium.com <abhay.aggarwal@windsurf.com>
Owner
|
The test coverage is not enough, please add more edge cases |
- Fixed timeout error test to match actual implementation behavior - Added 25+ new edge case tests covering error types, boundary conditions - Test non-retryable exceptions, mixed error scenarios, environment variations - Test response handling edge cases and exact timing verification - Addresses GitHub PR feedback requesting more robust testing Co-Authored-By: abhay.aggarwal@codeium.com <abhay.aggarwal@windsurf.com>
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.
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