Repository navigation
atunnel: bound the tunnel open by a deadline - #2654
Merged
Lior Lieberman (LiorLieberman) merged 1 commit intoOct 14, 2026
Merged
Lior Lieberman (LiorLieberman) merged 1 commit into
Lior Lieberman (LiorLieberman) merged 1 commit into
Conversation
Yuan Gao (ygao-g)
force-pushed
the
atunnel-tunnel-open-deadline
branch
from
October 14, 2026 16:11
d45bbb7 to
3f783c6
Compare
Bound the tunnel open by a 10s deadline, after timeout tunnel end the dial context and withdraw HTTP/2 CONNECT from the gateway's queue. Otherwise, even if the actor's client gives up within seconds, the queued CONNECT on gateway still keep its slot and then opens a tunnel nobody wants.
Yuan Gao (ygao-g)
force-pushed
the
atunnel-tunnel-open-deadline
branch
from
October 14, 2026 16:29
3f783c6 to
59d1a02
Compare
Yuan Gao (ygao-g)
requested review from
Lior Lieberman (LiorLieberman) and
Bowei Du (bowei)
October 14, 2026 16:43
Lior Lieberman (LiorLieberman)
approved these changes
Oct 14, 2026
Lior Lieberman (LiorLieberman)
left a comment
Collaborator
There was a problem hiding this comment.
lgtm. fwiw if the actor bails early the queued CONNECT still sits there until the 10s mark (IIUC), maybe a follow-up to cancel on downstream close?
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.
Fixes #2619
atunnel waited for the gateway's CONNECT answer for as long as the actor stayed active. A gateway at its connection cap queues the CONNECT; the actor's client gives up in seconds, but the queued CONNECT kept its slot and later opened a tunnel nobody wanted.
The tunnel open now has a 10s deadline on the Egress side. Since the HTTP/2 multiplexing change, ending the dial context already resets the CONNECT stream, which withdraws it from the gateway's queue; this PR adds the test that pins that behavior and the deadline that triggers it for an actor that has gone away. A tunnel already returned is unaffected. The HTTP/1 fallback path is left as it was.
Tested with
go test -race -count=20 ./internal/atunnel/...and thehack/verifyscripts. New test: an Egress with a shortened timeout, dialing through the real client to a gateway that never answers, closes the actor's connection at the deadline while the gateway sees the stream reset.Prepared with help from an AI coding agent; reviewed and verified by the author.