Repository navigation
Track forwarded tunnel connections by socket - #347033
Merged
Alex Ross (alexr00) merged 2 commits intoNov 11, 2026
Merged
Alex Ross (alexr00) merged 2 commits into
Alex Ross (alexr00) merged 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the socket-identity-based tunnel connection cleanup change.
No open issues 🎉
What changed in this PR
Fixes #347032 by tracking built-in Node tunnel connections by socket identity, so stopping port forwarding closes all established connections rather than only the newest one.
Changes:
- Keys disposal callbacks by socket and removes each entry on close.
- Adds regression coverage for single and concurrent connections, including disconnecting one before stopping forwarding.
- Adds an isolated loopback fixture using the real protocol handshake and data exchange.
| File | Description |
|---|---|
src/vs/platform/tunnel/test/node/tunnelService.test.ts |
Adds three connection-cleanup regression cases using a child-process fixture. |
src/vs/platform/tunnel/test/node/fixtures/tunnelServiceConnection.ts |
Exercises tunnel shutdown over loopback sockets with real handshakes and data exchange. |
src/vs/platform/tunnel/node/tunnelService.ts |
Tracks disposal callbacks by socket identity and deletes entries on close. |
Review effort: Balanced
Alex Ross (alexr00)
approved these changes
Nov 11, 2026
Alex Ross (alexr00)
left a comment
Member
There was a problem hiding this comment.
Thanks for the PR!
Alex Ross (alexr00)
enabled auto-merge (squash)
November 11, 2026 16:20
roblourens
approved these changes
Nov 11, 2026
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 #347032
Related to microsoft/vscode-remote-release#2237.
Connections on the same tunnel listener share
localAddress, so the disposal map retains only the most recent callback. Key it by socket identity and remove each socket's entry on close. Existing registration guards and graceful shutdown remain.The regression fixture opens/closes the actual tunnel service, completes the real protocol handshake over ephemeral loopback sockets and exchanges data before teardown. A single-connection control passes on base; two concurrent connections and disconnecting one before stopping forwarding fail. All 31 selected checks pass after the fix.
Client compilation/typecheck and targeted lint, including explicit lint for the new fixture, pass. The 1.145.2 implementation is identical. Pending-handshake disposal and a packaged workbench/remote-host scenario are outside the validation claim.