Add jittered retry backoff controls#1667
Open
RitwijParmar wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
min_timeout,max_timeout,factor, andrandomize, wired through validation, request context, andretryRequestWhy
Issue #1404 reports retry-induced p95/p99 tail amplification during upstream turbulence. The previous
retryRequestpath passedrandomize: falsetoasync-retry, which can make many retrying requests fire again on the same deterministic cadence. This gives operators a small, backwards-compatible way to jitter and bound retry delays while preserving the existing attempts/status-code behavior.Validation
npx jest tests/unit/src/handlers/retryHandler.test.ts --runInBandnpx prettier --check cookbook/getting-started/automatic-retries-on-failures.md src/handlers/retryHandler.ts src/handlers/handlerUtils.ts src/handlers/services/requestContext.ts src/middlewares/requestValidator/schema/config.ts src/types/requestBody.ts tests/unit/src/handlers/retryHandler.test.tsgit diff --checknpm run build(passes; existing repo warnings about external deps/circular deps and pre-existing provider type warnings still appear)Closes #1404