ts_tunnel: manage event lifecycle better, and recover from the stuck responder state - #390
Merged
Conversation
npry
approved these changes
Aug 28, 2026
…etime Signed-off-by: David Anderson <danderson@tailscale.com> Change-Id: Icf2ccebcc78b533ac2534047c9a4c14d6a6a6964
Updated #339 Signed-off-by: David Anderson <danderson@tailscale.com> Change-Id: I86fd4c687bb92bab731c3460f63130c66a6a6964
danderson
force-pushed
the
push-rtkmvntrsooq
branch
from
September 1, 2026 18:04
354072f to
9ea20ad
Compare
danderson
enabled auto-merge (rebase)
September 1, 2026 18:04
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.
Two separate commits.
The first just replaces an uncancelable event with an event that gets canceled when the related session state is dropped, so we avoid some unnecessary timer callbacks.
The second cleans up half-completed handshakes in the responder role, where the initiator never confirms the session. Previously ts_tunnel just got stuck in that scenario, with the pending handshake unable to ever be cleared. With this change, it follows the behavior of the reference implementation and abandons the handshake when the unconfirmed session expires (i.e. couldn't be confirmed any more even if the initiator tried).
This allows a stuck responder to eventually recover, and potentially become the initiator later on if it wants to transmit.
Updates #339