Skip to content

Conversation

@n1ghter
Copy link

@n1ghter n1ghter commented Nov 27, 2025

Problem

When Jira Server or Confluence Server returns HTTP 429 (Rate Limiting) with a Retry-After header containing a large value, the library throws an OverflowError: timestamp too large to convert to C _PyTime_t error.

This fixes issue #1600 and related issues #1499 and #1593.

Solution

  • Added _parse_retry_after_header method that safely parses Retry-After headers (supports both delta-seconds and HTTP-date formats)
  • Clamps header values to max_backoff_seconds to prevent overflow
  • Updated _retry_handler to use the safe parser instead of direct int() conversion
  • Added comprehensive tests for edge cases

Changes

  • atlassian/rest_client.py: Added safe Retry-After parsing with overflow protection
  • tests/test_rest_client.py: Added tests for large values, HTTP-date parsing, and invalid headers

Testing

  • All existing tests pass
  • New tests verify overflow protection works correctly
  • Docker image built and tested with mcp-atlassian integration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant