Skip to content

Connection unaware of reboots/graceful disconnect #9117

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

Open
timonsku opened this issue Oct 19, 2023 · 7 comments
Open

Connection unaware of reboots/graceful disconnect #9117

timonsku opened this issue Oct 19, 2023 · 7 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@timonsku
Copy link

Type: Bug

When rebooting a Linux remote host, VSCode does not seem to be aware of that and tries to reconnect to the session.
Which would be wanted behaviour but it never manages to reconnect once the host is back up and you need to wait until VSCode fails completely and offer the option to reload the window.
This process does not seem to be affected at all by the settings for reconnect timeouts and attempts and can last very long in some instances.

Expected behaviour would be to be aware of the system reboot and reopen a new socket once the host is available again. It seems right now it gets stuck in trying to reuse the old connection.

Extension version: 0.106.5
VS Code version: Code 1.83.1 (f1b07bd25dfad64b0167beb15359ae573aecd2cc, 2023-10-10T23:48:05.904Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Remote OS version: Linux arm64 6.1.58-v8+

System Info
Item Value
CPUs AMD Ryzen 9 3900X 12-Core Processor (24 x 3800)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 63.92GB (27.13GB free)
Process Argv --crash-reporter-id 903441b5-a829-4195-82ee-76ecd1d30705
Screen Reader no
VM 27%
Item Value
Remote SSH: 192.168.0.31
OS Linux arm64 6.1.58-v8+
CPUs Cortex-A72 (4 x 1500)
Memory (System) 3.70GB (3.12GB free)
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
vslsvsres303:30308271
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vsdfh931:30280409
vshan820:30294714
vstes263:30335439
vscoreces:30445986
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
py29gd2263cf:30856253
vsclangdf:30486550
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
282f8724:30602487
89544117:30613380
2i9eh265:30646982
showlangstatbar:30737416
962ge761:30841074
03d35959:30757346
pythonfmttext:30731395
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
gsofa:30866041
pythonnosmt12:30797651
pythonidxpt:30805730
pythonnoceb:30805159
copilotsettingt:30859503
synctok:30821570
dsvsc013:30795093
dsvsc014:30804076
diffeditorv1:30821571
dsvsc015:30845448
pythontestfixtcf:30866406
pyreplss1:30865275
pythontbext0:30864172

@bamurtaugh
Copy link
Member

Thanks for sharing these details. Just to clarify - which remote extension(s) are you using?

@bamurtaugh bamurtaugh added the info-needed Issue requires more information from poster label Dec 13, 2024
@timonsku
Copy link
Author

No specific extensions. This is about the behavior of remote connections in general

@joshspicer
Copy link
Member

joshspicer commented Dec 16, 2024

I'm a little confused what you're asking here. If you've rebooted your remote host, how would VS Code know that? From ssh's perspective, didn't the host just go offline (which perhaps also happened due to flakey internet, which is why a reconnect would be preferred)?

Could you disconnect from your remote host before rebooting it?

@joshspicer joshspicer added info-needed Issue requires more information from poster and removed info-needed Issue requires more information from poster labels Dec 16, 2024
@timonsku
Copy link
Author

timonsku commented Dec 16, 2024

It is not about the VScode server knowing if the reason was a reboot, that is of course not possible as it would be killed by the remote host before it could even notify of that. The SSH connection will be disconnected by the remote host though, that is something that can be caught by the SSH client on the local host. Either by catching the ssh host closing the pipe or if that was missed via a keep-alive timeout like most SSH clients implement.

There are two connected issues that I am experiencing. The first is that sometimes the local VScode instance does not give up on a broken connection/pipe at all, e.g. the reconnect timeout setting seems to do nothing and I have to close VScode and re-open it to resume.

Then secondly, the time it takes to reconnect to an alive host is generally very long. I can be reconnected to the host with my SSH session on the terminal for over a minute and VScode is still trying to use the old pipe until it eventually determines that it won't try again and then does the pop-up where it asks if it should reconnect, which restores my connection on a new pipe. The latter is the the behavior I would like to have but without the possible endless spiral or the long delay of trying to re-use the pipe it was connected to before.
One option to achieve this could be that the keep-alive timeout is fixed (or if that timeout value present in the settings atm. does not serve that purpose expose a keep-alive timeout in the settings). When the timeout runs out it should ask to reconnect (ideally with an option to always auto reconnect for the current "coding session" e.g. until vscode is restarted).

This is something that does not heavily affect typical server work where you rarely reboot but when working on remote embedded Linux systems f.e. where you need to frequently reboot to apply a kernel level change, this can quickly become very tedious.

E: Closing the connection manually is not really a good solution as that means closing the entire window which is what I would like to avoid to constantly restart VScode and reconnect to a client going through the full connection flow again.

Copy link

Hey @connor4312 @joshspicer, this issue might need further attention.

@timonsku, you can help us out by closing this issue if the problem no longer exists, or adding more information.

Copy link

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@vs-code-engineering vs-code-engineering bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 24, 2025
@timonsku
Copy link
Author

Informationen was provided. Not sure why this got auto closed?

@bamurtaugh bamurtaugh reopened this Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

4 participants