fix(opencode): cap exponential retry backoff to 30s max#17834
Open
TomRoyls wants to merge 1 commit intoanomalyco:devfrom
Open
fix(opencode): cap exponential retry backoff to 30s max#17834TomRoyls wants to merge 1 commit intoanomalyco:devfrom
TomRoyls wants to merge 1 commit intoanomalyco:devfrom
Conversation
Removes the unbounded exponential backoff fallback when response headers are present but don't contain retry-after info. Now all fallback paths use the capped backoff (30s max) from RETRY_MAX_DELAY_NO_HEADERS. Fixes anomalyco#8769
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
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.
Issue for this PR
Closes #8769
Type of change
What does this PR do?
The retry logic had two fallback paths for exponential backoff:
RETRY_INITIAL_DELAY * Math.pow(RETRY_BACKOFF_FACTOR, attempt - 1)— no capMath.min(..., RETRY_MAX_DELAY_NO_HEADERS)— 30s maxWhen response headers were present but didn't contain
retry-after-msorretry-after, the code fell through to the unbounded path. After 13 retries this results in 4+ hour delays.This removes the unbounded fallback so all cases use the capped version (30s max).
How did you verify your code works?
Ran the retry tests: all 18 pass.
Screenshots / recordings
N/A - no UI changes
Checklist