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

@dustinbyrne dustinbyrne left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The retry jitter is applied before the 30-second cap and preserves the bounded Retry-After floor across both capture lanes. No issues found in this PR’s delta.

AI-assisted review.

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>
@eli-r-ph
eli-r-ph force-pushed the v1-identity-context branch from d8d308c to a1ddf21 Compare October 21, 2026 00:25
@eli-r-ph
eli-r-ph force-pushed the v1-identity-context branch 2 times, most recently from d8d308c to a1ddf21 Compare October 21, 2026 01:03

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.

2 participants