fix(capture): cap v0 retry delays - #814
Merged
Merged
Conversation
Contributor
posthog-python Compliance ReportDate: 2026-07-31 09:50:20 UTC ✅ All Tests Passed!111/111 tests passed Capture_V1 Tests✅ 94/94 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
marandaneto
marked this pull request as ready for review
July 31, 2026 07:43
Contributor
|
Reviews (1): Last reviewed commit: "fix(capture): cap v0 retry delays" | Re-trigger Greptile |
ioannisj
approved these changes
Jul 31, 2026
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
Capture v0 treated a positive
Retry-Afterresponse header as an unbounded replacement for its configured exponential backoff. A server-provided numeric value or far-future HTTP date could therefore block the consumer thread for an unexpectedly long time, while a small value could reduce the existing retry delay.This change aligns v0 with the bounded retry behavior already used by capture v1: both the exponential delay and
Retry-Afteruse the shared 30-second ceiling, and the actual wait is their maximum.💚 How did you test it?
/Users/marandaneto/Github/posthog-python/.venv/bin/python -m pytest posthog/test/test_consumer.py -q(30 passed)/Users/marandaneto/Github/posthog-python/.venv/bin/ruff check posthog/consumer.py posthog/test/test_consumer.py/Users/marandaneto/Github/posthog-python/.venv/bin/ruff format --check posthog/consumer.py posthog/test/test_consumer.pygit diff --checkRegression coverage verifies huge and small numeric and HTTP-date
Retry-Aftervalues and confirms the configured number of attempts is preserved.📝 Checklist
If releasing new changes
sampo addto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
A human directed the scope and PR requirements. Pi coding agent using GPT-5.6-sol (session
019fb2fd-ad74-70b3-a210-34f28b8ed762) implemented the bounded delay and regression tests; Pi's autoreview tool independently reported no actionable findings. The implementation reuses capture v1's existing retry ceiling rather than introducing a second constant, and intentionally preserves v0's retry count and retryable-status behavior.This PR requires human review and is not intended for autonomous merge.