You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: code server goes to "Sleeping State" when closing the browser #5589
open code-server (I'm using k8s and run the pod with cpu limit N)
run some heavy cpu-bound job in the terminal of code-server client (something like stress -c N)
close the browser
code-server (parent pid) and child processes including cpu-bound job go to sleeping state occassionally.
Expected
The server should be in a running state regardless of client connection
Actual
The code-server process should be in a running state but occasionally goes to a sleeping state.
This leads to other terminal child processes also going to a sleeping state.
Logs
Screenshot/Video
Does this issue happen in VS Code or GitHub Codespaces?
What do you mean by the process going into a sleeping state? I think VS Code kills terminal processes if they are not reconnected within a timeout, could that be the cause?
Activity
ky1emoon commentedon Sep 26, 2022
I believe this might be related to microsoft/vscode-remote-release#3096, but not sure.
jsjoeio commentedon Sep 26, 2022
🤔 if that is related and it is upstream, we not be able to do much. cc @code-asher in case you have any thoughts/ideas!
code-asher commentedon Sep 28, 2022
What do you mean by the process going into a sleeping state? I think VS Code kills terminal processes if they are not reconnected within a timeout, could that be the cause?
Creling commentedon Oct 1, 2022
Well, I think background jobs should be guaranteed alive by tmux, screen or something similiar, but not code-server.
If you ssh to a remote server and run some jobs, you should not expect it to keep working after closing the ssh connection, so do code-server.
code-asher commentedon Oct 4, 2022
Ah so the issue is that code-server is not terminating jobs when closing the browser?
The reason they stay alive is in case the browser temporarily loses connectivity so it can reconnect the terminals once the network comes back up.
It is supposed to eventually kill the jobs after a timeout I believe (I think it is five minutes).
code-asher commentedon Jul 12, 2024
Closing as stale but feel free to comment if you come back to this. This behavior is defined by VS Code though so any changes will need to go there.