fix: honor HTTP-date Retry-After in async requests - #931
Merged
marandaneto merged 1 commit intoSep 8, 2026
Conversation
Member
|
thanks @Bortlesboat |
marandaneto
approved these changes
Sep 8, 2026
marandaneto
enabled auto-merge (squash)
September 8, 2026 11:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 Motivation and Context
Async requests now honor
Retry-Afterwhen the server supplies an HTTP date. Previously, a 503 asking the legacy async consumer to wait ten seconds retried after one second because only numeric headers were parsed. Reusing the existing v1 parser keeps the consumer's backoff and 30-second cap intact.💚 How did you test it?
test_async_consumer.py,test_async_request.pyandtest_capture_v1.py. Two new date cases fail before the fix. The regression uses realhttpx.MockTransportresponses, frozen time and mocked sleeps.6b0c98f. The eight fixture errors pass with an isolated--basetemp; the remaining failures depend on POSIX path separators oros.register_at_fork.📝 Checklist
If releasing new changes
sampo addto generate a changeset file. The equivalentpypi/posthog: patchchangeset was written directly in.sampo/changesets/.🤖 Agent context
Autonomy: Human-driven (agent-assisted)
The author requested additional open-source contributions. Codex (GPT-6) selected this defect, implemented the fix, ran the tests and performed the code review with Git, GitHub CLI, uv, pytest, Ruff and mypy. The implementation reuses the existing parser; the regression exercises the transport-to-consumer path. No shareable session link is available. Maintainer human review is still required.
The human driver/DRI is
Bortlesboat. GitHub rejected self-assignment for this external contributor (403); a maintainer needs to set the PR assignee.Post-Deploy Monitoring & Validation
No additional operational monitoring required; the existing retry limits are preserved and the changed header behavior is covered by deterministic regression tests.