Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Bug]: code-server hang #5822

Unanswered
ericzhucode asked this question in Q&A
Nov 22, 2022 · 2 comments · 7 replies
Discussion options

Is there an existing issue for this?

  • I have searched the existing issues

I know this issue may not be caused by code-server but nodejs since when process hangs, it seems no any js code is running and all nodejs environment stucks. Just post this here to see if it's possible to get professional suggestions from your team.
I will also post this issue at nodejs community
Thank you for your team's effort!

OS/Web Information

  • Web Browser: Chrome/Edge(This issue is only related to backend process on Linux system)
  • Local OS: Win10/Win11
  • Remote OS: Linux CentOS
  • Remote Architecture:
  • code-server --version: 4.1.0 / 4.2.0 / 4.4.0 (Some customers are upgrading to 4.5.3 now and we will monitor if this version also has the issue)

Steps to Reproduce

  1. start code-server
  2. use code-server as usual
  3. after about one week to one month, the code-server hangs
  4. we can't reproduce this issue manually as this always happens suddenly and unexpectedly

Troubleshooting so far

  1. We can't open code-server in browser as chrome shows no response at all, but port access is still avaiable when we use telnet
  2. We can find code-server process still exists and it is still listening on the port (with telnet 127.0.0.1 8080)
    process
  3. We even can't curl on the local linux machine and there's no response at all
    noresponse

(if it's working then we should see the direction infomation like)
redirect

  1. We generated core file of the hang process (I mean the process executing entry.js) and use gdb to debug it. When we use bt to look at the frames, we can get the following content
    core file
    We get this core files from over 20+ of our users and the contents are all the same, showing nodejs is stucking at
    write() from /lib64/libpthread.so.0

Expected

nodejs server in linux backend system should response when we use curl or open IDE in browser

Actual

nodejs process in linux backend system hangs and no response at all

Logs

from ~/.local/share/code-server/code-server-stderr.log
We found the following logs and it seems that there's network traffic issue in socket connection but I don't know how we use these information to troubleshoot. I will be appreciated it if you team can suggest something.
image

Screenshot/Video

No response

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

No response

You must be logged in to vote

Replies: 2 comments 7 replies

Comment options

This is a tough one 🤔 Nothing obvious is coming to me after reading your logs. @code-asher any ideas? I'm not sure if long-running processes have issues or something.

What happens if you restart code-server? Does it work then?

You must be logged in to vote
7 replies
Comment options

Fascinating! Yeah there was a problem with stdout not being consumed although I only saw this after a hotswap (which code-server performs when it receives a SIGUSR1 or SIGUSR2) so I am not sure how the issue would trigger without a hotswap but if it does that would explain it.

Comment options

Fascinating! Yeah there was a problem with stdout not being consumed although I only saw this after a hotswap (which code-server performs when it receives a SIGUSR1 or SIGUSR2) so I am not sure how the issue would trigger without a hotswap but if it does that would explain it.

Can I ask more about hotswap you mentioned above? I know signal SIGUSR1 and SIGUSR2 since we sometimes use that in order to do an attach debug, but what does hotswap mean? Is it a feature controlled by code-server code or by express frameworks or nodejs?

Comment options

In this case I mean code-server restarts itself. code-server's top-level process is a thin wrapper that starts the main code-server process and when the top-level code-server process receives SIGUSR1 or SIGUSR2 it restarts the main code-server process. I think in the pipe implementation when the main process streams closed they closed the top-level ones too.

Comment options

We should probably remove SIGUSR1 since that overlaps with debugging Node.

Comment options

Much appreciated for your insights!

Comment options

I've had the same problem

code-server: v4.102.1
Code: 1.102.1
Commit: 47e9d43
Date: 2025年07月17日T18:59:27.470Z (2 mos ago)
Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
bug Something isn't working triage This issue needs to be triaged by a maintainer
Converted from issue

This discussion was converted from issue #5805 on November 30, 2022 17:01.

AltStyle によって変換されたページ (->オリジナル) /