Fix Retry-After header overflow error (closes #1600) #1602
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.
Problem
When Jira Server or Confluence Server returns HTTP 429 (Rate Limiting) with a
Retry-Afterheader containing a large value, the library throws anOverflowError: timestamp too large to convert to C _PyTime_terror.This fixes issue #1600 and related issues #1499 and #1593.
Solution
_parse_retry_after_headermethod that safely parses Retry-After headers (supports both delta-seconds and HTTP-date formats)max_backoff_secondsto prevent overflow_retry_handlerto use the safe parser instead of directint()conversionChanges
atlassian/rest_client.py: Added safe Retry-After parsing with overflow protectiontests/test_rest_client.py: Added tests for large values, HTTP-date parsing, and invalid headersTesting