Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error handling in Client consulDiscoveryImpl #14431

Merged
merged 2 commits into from
Sep 2, 2022

Conversation

nvx
Copy link
Contributor

@nvx nvx commented Sep 1, 2022

Trivial one-liner fix, added a missing continue on non-nil error to avoid accidentally using a bad peer.

I ran into this while updating a single server test cluster to raft version 3 (https://www.nomadproject.io/docs/upgrade#upgrading-a-single-server-cluster-to-raft-version-3) by creating a raft.peers file manually and forgetting to include the port in the address field. This resulted in clients discovering via Consul to appear to successfully detect a server, but then later failing with errors like this:

client.rpc: error performing RPC to server: error="rpc error: failed to get conn: dial tcp: address <nil>: missing port in address" rpc=Node.GetClientAllocs server=<nil>

This fix will allow allow the client to check for other servers with functional Status.Peers responses, or in the absence of a functional server at least return a relevant error in the right place.

Added a missing `continue` on non-nil error to avoid accidentally using a bad peer.
@lgfa29 lgfa29 added backport/1.1.x backport to 1.1.x release line backport/1.2.x backport to 1.1.x release line backport/1.3.x backport to 1.3.x release line labels Sep 2, 2022
Copy link
Contributor

@lgfa29 lgfa29 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, thank you @nvx 🙂

I added a changelog entry for this fix.

@github-actions
Copy link

github-actions bot commented Jan 1, 2023

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/1.1.x backport to 1.1.x release line backport/1.2.x backport to 1.1.x release line backport/1.3.x backport to 1.3.x release line
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants