Fix removing tunnels when the tunnel factory throws an error#186566
Merged
alexr00 merged 3 commits intomicrosoft:mainfrom Jun 29, 2023
Merged
Fix removing tunnels when the tunnel factory throws an error#186566alexr00 merged 3 commits intomicrosoft:mainfrom
alexr00 merged 3 commits intomicrosoft:mainfrom
Conversation
joshaber
commented
Jun 28, 2023
bpasero
approved these changes
Jun 29, 2023
meganrogge
approved these changes
Jun 29, 2023
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
If the tunnel factory in the web throws an error, VS Code will catch that error but maintain a port mapping for that port, which means if you try to forward the same port again, it won't re-call the tunnel factory since it thinks it's already forwarding the port.
Steps to reproduce
vscode/src/vs/platform/tunnel/common/tunnel.ts
Line 468 in e7ee47c
undefined: https://github.com/microsoft/vscode/blob/e7ee47c5ec2046533cb9017d7c403b32e2bfebd2/src/vs/workbench/contrib/remote/browser/tunnelFactory.ts#L65C1-L68vscode/src/vs/platform/tunnel/common/tunnel.ts
Line 344 in e7ee47c
await'ing the tunnel promise itawaits the object from the tunnel map that contains the promise:vscode/src/vs/platform/tunnel/common/tunnel.ts
Line 419 in e7ee47c
vscode/src/vs/platform/tunnel/common/tunnel.ts
Line 420 in e7ee47c
cc @alexr00