Skip to content

fix: fall back from nonfinite Retry-After values - #742

Open
Shubham-Padkonde wants to merge 1 commit into
workos:mainfrom
Shubham-Padkonde:fix/finite-retry-after
Open

Shubham-Padkonde wants to merge 1 commit into
workos:mainfrom
Shubham-Padkonde:fix/finite-retry-after

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown

Description

A malformed Retry-After header such as NaN, Infinity, or an overflowing numeric value currently reaches time.sleep/asyncio.sleep. This can replace the API error with a ValueError/OverflowError or leave an asynchronous retry waiting indefinitely.

Treat nonfinite numeric values as invalid headers and use the existing exponential backoff, just as for other unparseable Retry-After values. Valid numeric values and HTTP dates retain their behavior.

Six sync/async response regressions fail before the fix and pass afterward. The complete suite passes: 2,887 tests. Ruff and git diff --check pass.

Documentation

No public API or documentation changes required.

@greptile-apps

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Changes retry logic for rate-limit handling.

The PR appears safe to merge; no actionable regression was identified.

Summary

The PR rejects nonfinite numeric Retry-After values so sync and async retries use exponential backoff instead of passing invalid delays to sleep.

  • Adds regression tests for NaN, Infinity, and overflowing numeric headers in both request paths.

Reviews (1) · Last reviewed commit: "fix: fall back from nonfinite retry-afte..."

This branch has not been deployed

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant