fix(cache): match client-go's reconnect backoff algorithm - #3026
Draft
davidgamero wants to merge 1 commit into
Draft
fix(cache): match client-go's reconnect backoff algorithm#3026davidgamero wants to merge 1 commit into
davidgamero wants to merge 1 commit into
Conversation
The reconnect delay doubled from a 1s base with no jitter, so every client disconnected by the same event (an apiserver rollout, a load balancer cycling) retried at the same instants and kept colliding. Adopt client-go's defaultBackoff* values from the reflector's ExponentialBackoffManager: an 800ms base, a factor of 2, a 30s cap, full jitter, and a reset once the backoff has gone unused for two minutes. Full jitter spreads each retry over [level, 2*level), which is what breaks up the lockstep, and the idle reset means a client that recovered stops paying for failures it has already outlived. Only the delay computation changes. When a reconnect backs off at all is untouched: the first reconnect is still free, and receiving a watch event or a TimeoutError still clears the delay. nowFn and randFn join delayFn as injectable options so the backoff can be asserted deterministically instead of by sleeping.
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: davidgamero The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
davidgamero
marked this pull request as draft
August 30, 2026 02:42
Contributor
Author
|
/hold waiting for CI fix |
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.
followup on #3022
ai disclosure: used opencode + claude