Skip to content

Add configurable retry jitter - #4517

Open
jaxalo wants to merge 1 commit into
masterfrom
jaxalo/retry-jitter
Open

Add configurable retry jitter#4517
jaxalo wants to merge 1 commit into
masterfrom
jaxalo/retry-jitter

Conversation

@jaxalo

@jaxalo jaxalo commented Aug 28, 2026

Copy link
Copy Markdown

What does this PR do?

Adds an optional RetryJitter duration to the API client retry configuration. When set, each 429 or 5xx retry delay receives an additive random delay in [0, RetryJitter).

The zero value keeps the existing deterministic retry behavior unchanged. Applying jitter to rate-limit reset retries as well as exponential backoff prevents clients with identical settings from retrying in lockstep.

Additional Notes

This is the prerequisite for exposing retry jitter in the Terraform provider.

Tested with:

  • go test ./api/datadog
  • go test ./api/datadog -run '^TestRetryJitter$' -count=20
  • cd tests && go test ./api
  • a local httptest server returning HTTP 500; observed retry gaps of 2.469s and 2.126s with a 2s backoff and 500ms jitter

Review checklist

  • This PR does not rely on API client schema changes.
    • The CI should be fully passing.

@jaxalo
jaxalo requested review from a team as code owners August 28, 2026 13:39
@jaxalo jaxalo added the changelog/Added Added features results into a minor version bump label Aug 28, 2026
@jaxalo
jaxalo marked this pull request as draft August 28, 2026 13:51
@jaxalo
jaxalo marked this pull request as ready for review August 28, 2026 15:41
@jaxalo

jaxalo commented Aug 28, 2026

Copy link
Copy Markdown
Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Aug 28, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-08-28 21:26:58 UTC ℹ️ Start processing command /merge


2026-08-28 21:27:04 UTC ℹ️ MergeQueue: Pull request is not mergeable yet

It will be processed automatically as soon as GitHub reports it as mergeable. View in MergeQueue UI.

  • Run /code blockers to see what is blocking it.
  • Run /remove to cancel it.

2026-08-29 01:30:11 UTC ⚠️ MergeQueue: This merge request was unqueued

devflow unqueued this merge request: It did not become mergeable within the expected time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/Added Added features results into a minor version bump mergequeue-status: removed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants