BUG1290387 Add retry support to pybsn.connect()#386
Open
andi-bigswitch wants to merge 2 commits intobigswitch:mainfrom
Open
BUG1290387 Add retry support to pybsn.connect()#386andi-bigswitch wants to merge 2 commits intobigswitch:mainfrom
andi-bigswitch wants to merge 2 commits intobigswitch:mainfrom
Conversation
Network connections can fail transiently due to temporary issues. This adds a retries parameter to enable automatic retry behavior with exponential backoff, improving reliability of HTTP clients without requiring manual HTTPAdapter configuration. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The initial documentation was misleading about what retries=3 does. This commit fixes the documentation and adds validation tests. Key clarifications: - retries=3 only retries GET, HEAD, OPTIONS, PUT, DELETE, TRACE - POST and PATCH are NOT retried even on connection errors - Integer values do NOT retry on HTTP status codes (only connection errors) - allowed_methods restricts retries for ALL failure types, not just status codes Changes: - Updated docstring with precise behavior description - Updated README with accurate documentation and warnings - Updated example comments to match tested behavior - Added test_retry_behavior_validation.py (6 tests) - validates configuration - Added test_retry_real_server.py (3 tests) - real HTTP server integration tests All 118 tests pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.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.
Summary
retriesparameter topybsn.connect()for automatic retry of failed HTTP requestsNone(default, no retries),int(simple retry count), orurllib3.util.retry.RetryobjectImplementation
RetriesTypetype alias and retry parameter toconnect()functionTesting
test_retry_connect.py- Connection setup and configuration (7 tests)test_retry_bigdbclient.py- Method-level retry behavior (9 tests)test_retry_bigdbclient_integration.py- Integration scenarios (8 tests)examples/retry_example.pywith 4 usage examples🤖 Generated with Claude Code
Fixes: BUG1290387