-
Notifications
You must be signed in to change notification settings - Fork 6.2k
[Bug]: code-server hang #5822
-
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
- start code-server
- use code-server as usual
- after about one week to one month, the code-server hangs
- we can't reproduce this issue manually as this always happens suddenly and unexpectedly
Troubleshooting so far
- 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
- We can find code-server process still exists and it is still listening on the port (with
telnet 127.0.0.1 8080
)
process - 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
- We generated core file of the hang process (I mean the process executing
entry.js
) and use gdb to debug it. When we usebt
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
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments 7 replies
-
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?
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
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?
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1 -
👀 1
-
We should probably remove SIGUSR1
since that overlaps with debugging Node.
Beta Was this translation helpful? Give feedback.
All reactions
-
Much appreciated for your insights!
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1
-
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
Beta Was this translation helpful? Give feedback.