Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[remote][connection] Allow offline editing in Remote-WSL #121799

Open
ozimos opened this issue Apr 21, 2021 · 9 comments
Open

[remote][connection] Allow offline editing in Remote-WSL #121799

ozimos opened this issue Apr 21, 2021 · 9 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug remote Remote system operations issues WSL Issue when using WSL
Milestone

Comments

@ozimos
Copy link

ozimos commented Apr 21, 2021

After successfully opening a VSCode editor in Remote-WSL mode and then some time after, I lose network connectivity, I want the editor to remain usable. The current behavior brings up the Disconnected. Attempting to reconnect modal. After dismissing the modal, the modal returns almost immediately, making it impossible to continue editing. I want to be able to continue editing the file until network connectivity is restored. Only VSCode features dependent on the network should be disabled

@chrmarti chrmarti assigned alexdima and unassigned chrmarti Apr 25, 2021
@alexdima alexdima added the remote Remote system operations issues label Jun 7, 2021
@alexdima
Copy link
Member

alexdima commented Jun 7, 2021

@ozimos Sorry for the slow response, I think I misunderstood this issue when I first read it. Do you use the regular WSL on your local machine? What do you mean "then some time after, I lose network connectivity"? Do you mean that you turn off your wi-fi?

@alexdima alexdima added the info-needed Issue requires more information from poster label Jun 7, 2021
@ozimos
Copy link
Author

ozimos commented Jun 8, 2021

Apologies for the muddled issue description. Yes, I use WSL2 on my windows machine. No, I do not turn off the wifi. But sometimes, the internet connection becomes unstable or goes down completely. At such times VSCode displays the Attempting to reconnect modal. When the modal is closed, it pops up immediately or shortly thereafter. While the modal is open, I cannot continue typing in the text editor. So after typing a few letters the modal pops open, I close it, type a few letters and the cycle repeats. I will try to reproduce by turning off my Wifi

@alexdima
Copy link
Member

alexdima commented Jun 9, 2021

I have investigated this and pushed bb01438 to log more information when disconnection occurs. Here is what I do:

  • I open a new WSL window
  • I go to the Windows Network Adapter Settings and disable my Ethernet network (the only active one besides vEthernet(WSL) ).
  • the VS Code windows continues to work correctly and everything is fine
  • I go and re-enable the Ethernet network
  • the browser WebSocket disconnects which sends us in the reconnection loop

This is what I see with the extra logging that I just pushed:

[2021-06-09 19:13:24.642] [renderer3] [info] [remote-connection][ExtensionHost][c2db8…][reconnect] received socket close event (wasClean: false, code: 1006, reason: ).
[2021-06-09 19:13:24.694] [renderer3] [error] {"isTrusted":true}
[2021-06-09 19:13:24.696] [renderer3] [info] [remote-connection][ExtensionHost][c2db8…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
[2021-06-09 19:13:24.696] [renderer3] [info] [remote-connection][ExtensionHost][c2db8…][reconnect] resolving connection...
[2021-06-09 19:13:24.696] [renderer3] [info] [remote-connection][ExtensionHost][c2db8…][reconnect] connecting to 172.26.138.234:45139...
[2021-06-09 19:13:24.696] [renderer3] [info] [remote-connection][Management   ][709a5…][reconnect] received socket close event (wasClean: false, code: 1006, reason: ).
[2021-06-09 19:13:24.697] [renderer3] [error] {"isTrusted":true}
[2021-06-09 19:13:24.697] [renderer3] [info] [remote-connection][Management   ][709a5…][reconnect] starting reconnecting loop. You can get more information with the trace log level.
[2021-06-09 19:13:24.698] [renderer3] [info] [remote-connection][Management   ][709a5…][reconnect] resolving connection...
[2021-06-09 19:13:24.698] [renderer3] [info] [remote-connection][Management   ][709a5…][reconnect] connecting to 172.26.138.234:45139...
[2021-06-09 19:13:32.773] [renderer3] [info] [remote-connection][Management   ][709a5…][reconnect] reconnected!
[2021-06-09 19:13:32.789] [renderer3] [info] [remote-connection][ExtensionHost][c2db8…][reconnect] reconnected!

And I can confirm that the WebSockets are being closed using the Network Tab:
image

@aeschli I would first ask that maybe you can investigate if WSL is the root cause of the closing WebSockets. If WSL is not the root cause of the socket disconnect, then I think we need help from @deepak1556 and create an issue for Chromium.

@alexdima alexdima assigned aeschli and unassigned alexdima Jun 9, 2021
@alexdima alexdima added WSL Issue when using WSL and removed info-needed Issue requires more information from poster labels Jun 9, 2021
@aeschli
Copy link
Contributor

aeschli commented Oct 18, 2021

Not sure if something has changed, but I'm not able to reproduce a disconnect. I tried the steps from #121799 (comment), tuning of th WSL Ethernet Adapter, Airplane mode, WIFI disconnect. I get reconnected correctly.
Closing the issue for now.

@aeschli aeschli closed this as completed Oct 18, 2021
@alexdima
Copy link
Member

@aeschli I can reproduce this consistently with the steps at #121799 (comment) . Notice how after re-enabling the network adapter, the web sockets get closed by Chromium or the OS, and then reconnection kicks in, which eventually succeeds (after a 30s timeout). Here is a screen recording:
TO_UPLOAD

@alexdima alexdima reopened this Oct 20, 2021
@aeschli
Copy link
Contributor

aeschli commented Oct 21, 2021

@alexdima Hm, I don't have a wired network adapter and would first have to organize/buy an USB-3 adapter/dock...

Do we want to extract the 'enable adapter triggers disconnect' into a new issue? I'm nor sure if/how it relates to the original reported issue.

@alexdima
Copy link
Member

@aeschli The original report is about dodgy wifi. So that means that the laptop loses wifi, gains wifi, loses wifi, gains wifi. I think every time wifi is gained our web sockets get disconnected. I can imagine how that can be excruciatingly annoying if you just try to work. To make it worse, it takes us about 30s to timeout until we end up reconnecting. I haven't thought about how to tackle this, but I first wanted to see if you can reproduce. Once you can reproduce, it would be interesting to see if a nodejs connection would be interrupted the same way or if this is something specific to Chromium. If also nodejs connections get interrupted, then I think this should be reported as a bug to WSL.

@aeschli
Copy link
Contributor

aeschli commented Oct 22, 2021

@alexdima As mentioned, I have made various tests around disconnecting/switching wireless, I see that we get into reconnection but for me it reconnects instantly.

@alexdima
Copy link
Member

@aeschli aeschli added the bug Issue identified by VS Code Team member as probable bug label Oct 22, 2021
@aeschli aeschli changed the title Allow offline editing in Remote-WSL [remote][connection] Allow offline editing in Remote-WSL Oct 29, 2021
@aeschli aeschli modified the milestones: Backlog, On Deck Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug remote Remote system operations issues WSL Issue when using WSL
Projects
None yet
Development

No branches or pull requests

4 participants