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

api: alloc exec recovers from bad client connection #7274

Merged
merged 1 commit into from
Mar 5, 2020
Merged

Conversation

notnoop
Copy link
Contributor

@notnoop notnoop commented Mar 4, 2020

If alloc exec fails to connect to the nomad client associated with the
alloc, fail over to using a server.

The code attempted to special case net.Error for failover to rule out
other permanent non-networking errors, by reusing a pattern in the
logging handling.

But this pattern does not apply here. net/http.Http wraps all errors
as *url.Error that is net.Error. The websocket doesn't, and instead
returns the raw error. If the raw error isn't a net.Error, like in
the case of TLS handshake errors, the api package would fail immediately
rather than failover.

Fixes #7233 .

If alloc exec fails to connect to the nomad client associated with the
alloc, fail over to using a server.

The code attempted to special case `net.Error` for failover to rule out
other permanent non-networking errors, by reusing a pattern in the
logging handling.

But this pattern does not apply here.  `net/http.Http` wraps all errors
as `*url.Error` that is net.Error.  The websocket doesn't, and instead
returns the raw error.  If the raw error isn't a `net.Error`, like in
the case of TLS handshake errors, the api package would fail immediately
rather than failover.
@notnoop notnoop added the theme/api HTTP API and SDK issues label Mar 4, 2020
@notnoop notnoop requested a review from drewbailey March 4, 2020 23:09
@notnoop notnoop self-assigned this Mar 4, 2020
@notnoop notnoop added this to Triaged in Nomad - Community Issues Triage via automation Mar 4, 2020
@notnoop notnoop merged commit 8fe78c2 into master Mar 5, 2020
Nomad - Community Issues Triage automation moved this from Triaged to Done Mar 5, 2020
@notnoop notnoop deleted the b-exec-tls branch March 5, 2020 15:16
notnoop pushed a commit that referenced this pull request Apr 9, 2020
api: alloc exec recovers from bad client connection
@github-actions
Copy link

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 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
theme/api HTTP API and SDK issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nomad alloc exec fails in TLS enabled clusters.
2 participants