Backport of peering: retry establishing connection more quickly on certain errors into release/1.13.x#13964
Merged
hc-github-team-consul-core merged 6 commits intorelease/1.13.xfrom Jul 29, 2022
Conversation
1c002e5 to
dda7b67
Compare
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.
Backport
This PR is auto-generated from #13938 to be assessed for backporting due to the inclusion of the label backport/1.13.
The below text is copied from the body of the original PR.
When running with an LB in front of the Consul servers, dialers need to retry their requests until they land on a leader server. The default retry backoff was too long because it started at 2s and went exponentially from there: 4s, 8s, etc. This change adds new retry logic for specific errors to retry quickly.
I opted to treat all
FailedPreconditionerrors as quick-retry errors because they should all be resolved quickly.Changes:
retryLoopBackoffwithretryLoopBackoffPeeringthat implements the new retry mechanicFailedPreconditionerror to not log as an error because they aren't indicative of an actual problemHandleStream()loop to add a new channel for errors. Previously, any error received fromRecv()would be swallowed and then we'd close therecvChand use that closing to trigger the loop to exit. Now we're sending that error through the new channel and handling it within the mainfor{}loop.