-
Notifications
You must be signed in to change notification settings - Fork 2k
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
client: respect client_auto_join
after connection loss
#11585
Conversation
The `consul.client_auto_join` configuration block tells the Nomad client whether to use Consul service discovery to find Nomad servers. By default it is set to `true`, but contrary to the documentation it was only respected during the initial client registration. If a client missed a heartbeat, failed a `Node.UpdateStatus` RPC, or if there was no Nomad leader, the client would fallback to Consul even if `client_auto_join` was set to `false`. This changeset returns early from the client's trigger for Consul discovery if the `client_auto_join` field is set to `false`.
b60f115
to
2df8b84
Compare
cc @davemay99 as a heads up, as I think I recall seeing this kind of thing in a support issue as well. |
The `consul.client_auto_join` configuration block tells the Nomad client whether to use Consul service discovery to find Nomad servers. By default it is set to `true`, but contrary to the documentation it was only respected during the initial client registration. If a client missed a heartbeat, failed a `Node.UpdateStatus` RPC, or if there was no Nomad leader, the client would fallback to Consul even if `client_auto_join` was set to `false`. This changeset returns early from the client's trigger for Consul discovery if the `client_auto_join` field is set to `false`.
The `consul.client_auto_join` configuration block tells the Nomad client whether to use Consul service discovery to find Nomad servers. By default it is set to `true`, but contrary to the documentation it was only respected during the initial client registration. If a client missed a heartbeat, failed a `Node.UpdateStatus` RPC, or if there was no Nomad leader, the client would fallback to Consul even if `client_auto_join` was set to `false`. This changeset returns early from the client's trigger for Consul discovery if the `client_auto_join` field is set to `false`.
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. |
Fixes #11404
The
consul.client_auto_join
configuration block tells the Nomadclient whether to use Consul service discovery to find Nomad
servers. By default it is set to
true
, but contrary to thedocumentation it was only respected during the initial client
registration. If a client missed a heartbeat, failed a
Node.UpdateStatus
RPC, or if there was no Nomad leader, the clientwould fallback to Consul even if
client_auto_join
was set tofalse
. This changeset returns early from the client's trigger forConsul discovery if the
client_auto_join
field is set tofalse
.To test this I ran a client node and a server node with Consul under Vagrant. Then I blocked access to the server's ports and Consul:
Then waited for the client to log that it had lost it's connection to the server, and removed the server rule while leaving the Consul rule in place:
And after a few moments, the client restored its connection with the server without needing to have Consul, as expected. I also did the same exercise without dropping packets to Consul and watched the logs to ensure that no requests were being made from the client to Consul to get the server address.