Skip to content

fix: retry capture requests that get 404 or 429 - #1132

Merged
eli-r-ph merged 2 commits into
v1from
v1-retry-404-429
Oct 27, 2026
Merged

eli-r-ph merged 2 commits into
v1from
v1-retry-404-429

Conversation

@eli-r-ph

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

The v1 SDKs now retry HTTP 404 and 429 on capture, like 408 and 5xx, so a temporary failure from capture or a proxy in front of it doesn't drop the batch on the first response.

  • _RETRYABLE_STATUSES adds 404 and 429; they leave _TERMINAL_STATUSES. They use the same backoff, jitter, Retry-After handling and retry budget, and raise CaptureError with their status after the last attempt.
  • The retry and exhaustion tests now run for 404, 429 and 503. The terminal-status test uses 402 in place of 429.
  • Migration guide: the retried status list now includes 404 and 429, and says how it differs from 7.x. A changeset describes the change.

💚 How did you test it?

  • pytest posthog/test (5338 passed) and ruff check/ruff format. The new 404 and 429 cases fail with the old status set.

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Ran sampo add to generate a changeset file

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Authored with Claude Code (Claude Opus 5.5), directed by @eli-r-ph.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eli-r-ph
eli-r-ph requested a review from a team as a code owner October 27, 2026 16:42
@eli-r-ph eli-r-ph self-assigned this Oct 27, 2026
Comment thread docs/migration-7.x-to-8.0.md Outdated
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eli-r-ph
eli-r-ph merged commit 150a6fe into v1 Oct 27, 2026
40 checks passed
@eli-r-ph
eli-r-ph deleted the v1-retry-404-429 branch October 27, 2026 21:05
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.

2 participants