Skip to content

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

Merged
eli-r-ph merged 1 commit into
v1from
v1-retry-jitter
Oct 22, 2026
Merged

eli-r-ph merged 1 commit into
v1from
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.

@eli-r-ph
eli-r-ph force-pushed the v1-identity-context branch from 3e65c58 to 727e867 Compare October 20, 2026 17:16
@eli-r-ph
eli-r-ph force-pushed the v1-retry-jitter branch 3 times, most recently from 61dc3f7 to dcdaae1 Compare October 20, 2026 23:40
@eli-r-ph
eli-r-ph force-pushed the v1-identity-context branch from 683f1b5 to d8d308c Compare October 20, 2026 23:40
@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
@eli-r-ph
eli-r-ph force-pushed the v1-identity-context branch from a1ddf21 to 36f39d2 Compare October 22, 2026 17:27
Base automatically changed from v1-identity-context to v1 October 22, 2026 17:29
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 <[email protected]>
@eli-r-ph
eli-r-ph merged commit 6fb23f9 into v1 Oct 22, 2026
37 of 40 checks passed
@eli-r-ph
eli-r-ph deleted the v1-retry-jitter branch October 22, 2026 17:33
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