Skip to content

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
backport/lkysow/peering-non-leader-backoff/accurately-enormous-mollusk
Jul 29, 2022
Merged

Backport of peering: retry establishing connection more quickly on certain errors into release/1.13.x#13964
hc-github-team-consul-core merged 6 commits intorelease/1.13.xfrom
backport/lkysow/peering-non-leader-backoff/accurately-enormous-mollusk

Conversation

@hc-github-team-consul-core
Copy link
Copy Markdown
Collaborator

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 FailedPrecondition errors as quick-retry errors because they should all be resolved quickly.

Changes:

  1. replace retryLoopBackoff with retryLoopBackoffPeering that implements the new retry mechanic
  2. change logging everywhere we receive a FailedPrecondition error to not log as an error because they aren't indicative of an actual problem
  3. refactor the main HandleStream() loop to add a new channel for errors. Previously, any error received from Recv() would be swallowed and then we'd close the recvCh and use that closing to trigger the loop to exit. Now we're sending that error through the new channel and handling it within the main for{} loop.

@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/lkysow/peering-non-leader-backoff/accurately-enormous-mollusk branch from 1c002e5 to dda7b67 Compare July 29, 2022 20:05
@hc-github-team-consul-core hc-github-team-consul-core merged commit fa66026 into release/1.13.x Jul 29, 2022
@hc-github-team-consul-core hc-github-team-consul-core deleted the backport/lkysow/peering-non-leader-backoff/accurately-enormous-mollusk branch July 29, 2022 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants