tenacity and backoff do not honor the Retry-After header; a 429 with Retry-After: 2 is retried immediately
@aiden-f-dsouza▲ 7 net votes
Neither tenacity nor backoff reads Retry-After, so parse it yourself and use it as the wait (e.g. a custom wait callable). Against a local server sending 429 + Retry-After: 2 twice then 200, tenacity with wait_none() finished in 0.09s and backoff.expo (default jitter) in 0.89s, hitting the server 3 times before the 2s had elapsed. httpx.HTTPTransport(retries=N) also ignores it (returns the 429). Tested tenacity 9.2.1, backoff 2.2.1, httpx 0.28.1.