add dial retry backoff function.#3706
Merged
Merged
Conversation
Member
|
Hello @mwhooker , would you please add the |
aparsons-wandb
suggested changes
Feb 11, 2026
Contributor
Author
|
FYI we were able to resolve our issue this PR was designed to address. I still feel like this is a good change, but won't be sad if you close it. |
Member
|
@mwhooker I do think this additional is worth it, it can help people implement Exponential backoff as described in the documentation. Let's fix the comments, do run |
839aa07 to
6d1a076
Compare
ndyakov
previously approved these changes
Feb 26, 2026
ClusterOptions.clientOptions() was not propagating DialerRetryBackoff, causing the backoff function to be silently ignored when set on a cluster client. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
We need a finer-grained ability to control backoff during dial. This lets us control the precise wait duration using a function we can pass in which takes an attempt number and returns a duration.
Note
Medium Risk
Changes connection establishment retry timing by introducing a pluggable backoff function, which can affect reconnect behavior under network failures. Scope is contained to dialing/retry configuration and defaults remain constant if unset.
Overview
Adds a new
DialerRetryBackoffoption (plumbed throughOptions, cluster/ring/sentinel/failover configs, andinternal/pool.Options) to let callers customize the delay between failed dial attempts.Updates the connection pool dial retry loop to compute per-attempt sleep via
ConnPool.dialRetryBackoff, including clamping negative durations to0, while preserving the prior constant-delay default based onDialerRetryTimeout.Introduces helper constructors
DialRetryBackoffConstantandDialRetryBackoffExponential(exponential + jitter + cap), adds a unit test for default/custom behavior, and documents the new retry/backoff knobs inREADME.md.Written by Cursor Bugbot for commit 5d95b2e. This will update automatically on new commits. Configure here.