Skip to content

[Bug]: code server goes to "Sleeping State" when closing the browser #5589

Closed as not planned

Description

@ky1emoon

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Web Browser: Chrome
  • Local OS: Windows 11
  • Remote OS: Ubuntu 20.04
  • Remote Architecture: amd64
  • code-server --version: 4.7.0

Steps to Reproduce

  1. open code-server (I'm using k8s and run the pod with cpu limit N)
  2. run some heavy cpu-bound job in the terminal of code-server client (something like stress -c N)
  3. close the browser
  4. 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

image

Screenshot/Video

image

Does this issue happen in VS Code or GitHub Codespaces?

  • I cannot reproduce this in VS Code.
  • I cannot reproduce this in GitHub Codespaces.

Are you accessing code-server over HTTPS?

  • I am using HTTPS.

Notes

I wonder if this is expected behavior.

Activity

  1. added
    bugSomething isn't working
    triageThis issue needs to be triaged by a maintainer
    on Sep 26, 2022
  2. ky1emoon commented on Sep 26, 2022

    @ky1emoon
    Author

    I believe this might be related to microsoft/vscode-remote-release#3096, but not sure.

  3. jsjoeio commented on Sep 26, 2022

    @jsjoeio
    Contributor

    🤔 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!

  4. code-asher commented on Sep 28, 2022

    @code-asher
    Member

    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?

  5. Creling commented on Oct 1, 2022

    @Creling

    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.

  6. code-asher commented on Oct 4, 2022

    @code-asher
    Member

    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).

  7. code-asher commented on Jul 12, 2024

    @code-asher
    Member

    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.

  8. added
    upstream:vscodeNeeds to be fixed upstream in VSCode
    and removed
    bugSomething isn't working
    triageThis issue needs to be triaged by a maintainer
    on Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstream:vscodeNeeds to be fixed upstream in VSCode

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions