Skip to content

fix: spread capture retry waits by up to 25% - #1058

Open
eli-r-ph wants to merge 1 commit into
v1-identity-contextfrom
v1-retry-jitter
Open

eli-r-ph wants to merge 1 commit into
v1-identity-contextfrom
v1-retry-jitter

Conversation

@eli-r-ph

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

Stacked on #1053. Capture retries used fixed waits, so clients that failed together all retried at the same moment and could overload capture again as it recovered. This PR spreads each wait.

Changes

  • Each capture retry wait varies randomly by up to 25%, on both the analytics and AI lanes.
  • The 30 s cap still applies after the spread.
  • A Retry-After header is still a minimum; the spread never shortens it.
  • Feature flag requests are unchanged.
  • Migration guide line and changeset.

💚 How did you test it?

  • Tests pin the lowest and highest spread, the cap, and Retry-After as a floor.
  • Removing the spread fails 3 tests; spreading after the cap fails 1.
  • ruff, mypy and the full test suite pass.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Written with Claude Code under the direction of the assignee.

🤖 Generated with Claude Code

@eli-r-ph eli-r-ph self-assigned this Oct 13, 2026
@eli-r-ph
eli-r-ph marked this pull request as ready for review October 13, 2026 18:04
@eli-r-ph
eli-r-ph requested a review from a team as a code owner October 13, 2026 18:04
@eli-r-ph
eli-r-ph force-pushed the v1-identity-context branch from 7ed86bf to 4dbd65a Compare October 14, 2026 03:11
Clients that fail together now retry at slightly different times, so they
do not all hit capture at once while it recovers. Retry-After still sets a
minimum wait, and the 30 s cap still applies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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