Fix some gRPC-tunneled connections#40632
Merged
espadolini merged 2 commits intomasterfrom Apr 18, 2024
Merged
Conversation
Contributor
Author
|
cc @dboslee |
rosstimothy
approved these changes
Apr 18, 2024
Contributor
rosstimothy
left a comment
There was a problem hiding this comment.
LGTM. Tested and verified that connectivity still works and graceful shutdown behaves as expected. 🚀
tigrato
approved these changes
Apr 18, 2024
|
@espadolini See the table below for backport results.
|
espadolini
added a commit
that referenced
this pull request
Apr 18, 2024
* Fix some gRPC-tunneled connections * Fix tests checking the return value of dial()
espadolini
added a commit
that referenced
this pull request
Apr 18, 2024
* Fix some gRPC-tunneled connections * Fix tests checking the return value of dial()
This was referenced Apr 18, 2024
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Apr 19, 2024
* Fix some gRPC-tunneled connections (#40632) * Fix some gRPC-tunneled connections * Fix tests checking the return value of dial() * go 1.21 compatibility
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Apr 19, 2024
* Fix some gRPC-tunneled connections (#40632) * Fix some gRPC-tunneled connections * Fix tests checking the return value of dial() * go 1.21 compatibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR mainly fixes a goroutine leak in the proxy peering client, where gRPC client streams used to tunnel connections were not correctly released in certain situations, for example when using app access across a proxy peering connection. The only practical way to shut down a client gRPC stream that unblocks reads and writes is to cancel its context, which was previously just a context associated with the proxy peering connection. With this PR, the proxy peering connections (and the proxy "sshgrpc" auth connections) now use a dedicated context that gets canceled on close.
As part of the fix, connection tracking for the proxy peering client was refactored as it was inherently vulnerable to a (controlled) panic as part of
sync.WaitGroupif a new outbound connection was attempted at the wrong time during a proxy shutdown.gRPC-tunneled auth dialing was also improved, as some minor refactors were necessary to fit the necessary changes to
streamutils.changelog: Fixed a resource leak in the Teleport proxy server when using proxy peering