Respecting Retry-After Without Hidden Retry Loops by Zhijian XuRespecting Retry-After Without Hidden Retry Loops by Zhijian Xu

Respecting Retry-After Without Hidden Retry Loops

Zhijian Xu

Zhijian Xu

Respecting Retry-After Without Hidden Retry Loops Independent demonstration — not client work (July 2026) A bounded Python retry helper now accepts both legal Retry-After formats, avoids an extra final sleep, and has deterministic tests. Problem A common API wrapper retries HTTP 429 immediately or understands only integer seconds. It can intensify rate limiting, make tests slow, and hide the real attempt budget. Approach I separated header parsing from retry orchestration, supported delta-seconds and HTTP-date values, made the attempt limit explicit, and injected the sleep function so the regression suite never waits in real time. Proof Four standard-library tests cover a successful retry, HTTP-date parsing, malformed-header fallback, and the final-attempt boundary. Verification: python3 -m unittest -v test_retry_after.py.
Like this project

Posted Jul 22, 2026

A bounded Python retry helper accepts both legal Retry-After formats, avoids an extra final sleep, and has deterministic tests.

Likes

0

Views

4

Timeline

Jul 1, 2026 - Jul 31, 2026