reverse_tunnel: proactively replace draining connections instead of GOAWAY#45519
Open
aakugan wants to merge 1 commit into
Open
reverse_tunnel: proactively replace draining connections instead of GOAWAY#45519aakugan wants to merge 1 commit into
aakugan wants to merge 1 commit into
Conversation
…OAWAY Signed-off-by: aakugan <aakashganapathy2@gmail.com>
9ee5bed to
423aa92
Compare
Contributor
|
/assign @botengyao |
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.
Commit Message
reverse_tunnel: proactively replace draining connections instead of GOAWAY
Description
Reworks the drain-aware HTTP connection manager used by reverse tunnels so that draining a connection no longer creates a window where the cluster has nowhere to route.
Why this change:
The HCM drains an HTTP/2 connection in two phases — shutdownNotice() (a graceful GOAWAY that stops new streams) followed by goAway() after drain_timeout. The problem for reverse tunnels: the moment a GOAWAY is observed, the responder's upstream nghttp2/oghttp2 adapter marks the connection Draining and refuses new streams on it. If no replacement tunnel exists yet, requests fail (503s) until a fresh tunnel is independently established.
What we do now:
during drain_timeout. The HCM's own goAway() then closes the old connection, by which point the cluster already has the new tunnel to route to.
Net effect: earlier, a GOAWAY made both client and server stop using the connection immediately, opening a connectivity gap. Now the server brings up a new tunnel first and only sends the GOAWAY once a replacement is ready, so the cluster transparently shifts to the new connection.
Future
Need to find some way of passing the info of draining to the cluster without preventing adapter from rejecting new stream creation which will allow us to notify the client consumers in advance to not "prefer" this tunnel.
Testing
Unit and Integ tests.