Skip to content

fix: cap Retry-After delays at maximum backoff duration - #269

Open
MuhammedAlkhudiry wants to merge 1 commit into
PostHog:mainfrom
MuhammedAlkhudiry:fix/cap-retry-after-backoff
Open

MuhammedAlkhudiry wants to merge 1 commit into
PostHog:mainfrom
MuhammedAlkhudiry:fix/cap-retry-after-backoff

Conversation

@MuhammedAlkhudiry

@MuhammedAlkhudiry MuhammedAlkhudiry commented Oct 18, 2026 •

Copy link
Copy Markdown

Motivation and context

A synchronous 429 or 503 response with Retry-After: 60 freezes an Octane, FrankenPHP, or queue worker for 60 seconds per retry, regardless of a lower maximum_backoff_duration. Cap retry waits at that existing millisecond limit while preserving smaller headers and exponential fallback. No public API change or divergence from the shared HTTP-client spec.

How did you test it?

Loopback HTTP tests capture sleeps without waiting: large numeric headers on 429/503, a small header, an HTTP-date header, and no header across two retries. The capped cases fail before the fix.

797 PHPUnit tests (5,781 assertions), 16 adapter tests, public API check, Composer validation, and project lint error checks pass. Existing deprecations/line-length warnings remain; project lint excludes third-party vendor code.

Checklist

  • Reviewed code and added regression tests.
  • No breaking change or docs update needed.
  • Ran pnpm change for a patch intent.

🤖 Agent context

Autonomy: Human-driven (agent-assisted).

Codex (GPT-6.1 Sol) in T3 Code used Git/GitHub CLI, Composer, PHPUnit, PHP_CodeSniffer, and pnpm. @MuhammedAlkhudiry directed the fix and approved publication; GitHub denied the assignee update, so maintainer assignment is needed. Private session; no public link. Uses the existing backoff limit and test-only sleep capture. Human review required.

@MuhammedAlkhudiry
MuhammedAlkhudiry requested a review from a team as a code owner October 18, 2026 12:23

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant