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: invalidated config should retain error #1068

Merged
merged 8 commits into from
Jan 20, 2022
Merged

fix: invalidated config should retain error #1068

merged 8 commits into from
Jan 20, 2022

Conversation

enocom
Copy link
Member

@enocom enocom commented Jan 10, 2022

When a TLS handshake fails, the client would invalidate the
configuration without recording the associated error. When the liveness
check runs, it would panic when trying to print the invalidated
configuration's error because the error was nil. This commit ensures
that when the proxy invalidates a configuration, it includes the error.

Fixes #1065.

When a TLS handshake fails, the client would invalidate the
configuration without recording the associated error. When the liveness
check runs, it would panic when trying to print the invalidated
configuration's error because the error was nil. This commit ensures
that when the proxy invalidates a configuration, it includes the error.

Fixes #1065.
@enocom enocom requested a review from kurtisvg January 18, 2022 22:57
@@ -38,7 +39,8 @@ func (c *Client) connectTLS(
// this file is conditionally compiled on only Go versions >= 1.17.
if err := ret.HandshakeContext(ctx); err != nil {
_ = ret.Close()
c.invalidateCfg(cfg, instance)
err = fmt.Errorf("config invalidated after TLS handshake failed, error = %w", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: consider moving the wrapping to add context ("config invalidated because error:") inside the invalidate function

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea. Should have thought of that myself.

@enocom enocom merged commit 49d3003 into main Jan 20, 2022
@enocom enocom deleted the healthcheck-fix branch January 20, 2022 19:25
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.

Panic in liveness endpoint
3 participants