-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
heartbeat file modify date keeps getting updated #2112
Comments
If you run I'll try to replicate as well as soon as I can. |
my service starts with systemctl start code-server@$USER, I modified the code-server.service file to include and restarted the systemctl , it seems still don't see any relevant log shows up when I do I do see some extension logs located at .../.local/share/code-server/logs/... |
Hi @code-asher I'm wondering if you can reproduce the same issue ? |
Odd, there should definitely be stdout. We also log stdout to I ran 3.5.0 but wasn't able to replicate the issue (Firefox & Chrome running locally on Linux):
I also double-checked the heartbeat file and the timestamp was at 22:19 which matches with the last heartbeat log. |
Hi @code-asher Thanks, |
Ah, there will be two connections per page since VS Code makes two
websocket connections. So with that in mind it looks like things are
working as expected, at least as far as these logs go.
|
Hi @code-asher PFA for the log. Thanks |
Ah yeah it definitely looks like some connection isn't closing.
I tried to replicate on 3.5.0 but I'm not having much luck. Here's what
I did based on your comment, do these look like the right steps?
1. Start code-server
2. Open code-server in the browser
3. Restart code-server
4. Click "reconnect now" or wait for VS Code to reconnect, it will fail
5. Click "reload window"
6. Once VS Code has connected, close the VS Code tab
Once I do these steps I get this for the next heartbeat:
```
[2020-10-16T15:48:13.213Z] trace 0 active connections
```
I tried it a few times but no luck yet.
It's also interesting that you get four connections at one point! Very
strange.
Do you know if this happens if you close your browser entirely?
|
Hi @code-asher so I just closed the whole browser chrome entirely, and after that, when I check the log, it's still updating every minute. I guess to reproduce, you have to have a new VM instance and then put the link in a iframe to open it when VM instance code server is ready. I noticed that for any code server vscode that had this issue and then If I open the vscode again, it will most likely update the connections to its correct amount and then if you close the browser tab, the connection will back to 0. |
Hmm that's very interesting. I'll try an iframe and maybe I can spin up
some VMs to test as well. I think what I'll do in the meantime is add
some more detailed logging which will hopefully help figure out what
connection isn't getting closed.
|
@code-asher Thanks |
Hi @OliverwengFiltered, can you try to reproduce this on v3.7.1? We've made major changes to the HTTP layer so it may be fixed. |
Hi @nhooyr , |
I'm going to tackle #2274 after the update to VS Code 1.51.1 which I'm
hoping to finish this week.
|
just switched to 3.7.3, so far so good, not seeing this issue anymore on v 3.7.3 |
That's awesome to hear!! 🎊 |
unfortunately, it happens on v3.7.3 too, I didn't have the enough data to draw a conclusion back then. but all our system has upgraded to v3.7.3 a week ago, and we still see this happens occasionally. Exactly same logging "trace 1 active connection" . Thanks |
Nooo :( Are you absolutely positive there isn't an active connection? You can check with |
here is what I see when do |
That's wild!! What version of node are you using? Did you install via a binary release or the npm package? Honestly I'm at my wits end, the code isn't very complicated so I'm not sure what's going on. |
@nhooyr |
Yea so the I'm honestly not really sure how to continue debugging this. I think we need a way to not only print that there is an active connection but where it's originating from and whether it's a websocket or HTTP @code-asher That could help narrow things down. |
Definitely agreed, we need a bunch more logging around this to figure it out I think. |
I wonder if it's the same issue here? #2061 In that issue it's only caused by Safari + iPad, so maybe not. |
This issue happens to me all the time. I'm using a chromebook to connect. There's a proxy between vs code and the chromebook, but that probably doesn't matter. The logs show:
There are definitely no open connections left when this is happening:
The local nodejs version is:
Code-server seems to have its own node version though:
This seems to happen very reliably when the chromebook fails asleep, so I suspect that nodejs is struggling with detecting when the connection goes away. vs code is being started by systemd, in case that's relevant lsof doesn't show anything interesting:
Starting and stopping the vs code client (browser tab) does fix the issue and the code-server logs go back to:
After the "fix", lsof and netstat show the same thing as before. |
Do you mind opening up a separate issue and filing a bug report with reproduction steps? We can take a closer look and hopefully find a fix. |
Ok. I'll try to narrow it down better first and come up with a repro that doesn't involve waiting for a chromebook to fall asleep :) |
Sorry, this turned out to be a pretty time consuming exercise. I don't think I'll be able to come up with a better repro easily. I tried disconnecting the network, but that didn't seem to work. I'm not sure exactly what happens at the network level when a chromebooks falls asleep. |
I've seen this occasionally as well but I'm not sure what exactly reproduces it. I think we should still try to add some more logging around what connections exactly are open to help figure it out. |
No worries at all. Thanks for trying @vikstrous2. Added to On Deck. We can at least try to reproduce ourselves again and then also add logging like code-asher said. |
I've encountered the same issue, after several try, and found below logs possible related:
Above can be reproduced as below steps: ENV: macOS15 + Code-Server:3.10.2 + Chrome91
And the logs will be appended Hope it's helperful! |
When I patched the output file
Maybe we can add some check for the real onMessage fired? If no message, no heartbeat? |
Fantastic notes @futurist 👏
Maybe you're right. @code-asher is more familiar with the heartbeat file so I'll let him weigh in on it when he is back next week. |
We could change the heartbeat mechanism to use onMessage or something
like that but I think that might disguise the problem that there is some
connection hanging open.
Currently we use `getConnections` on the server
(https://nodejs.org/api/net.html#net_server_getconnections_callback)
Since this returns >= 1 I think it means there is a connection failing
to close and we need to make sure it closes properly somehow.
|
I encountered this problem, too. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no activity occurs in the next 5 days. |
code-server --version
: 3.5.0the heartbeat file modify date seems acting a bit weird.
if you open the code server and then close the code server in a relatively short time window, and then ssh into the vm machine to check out the heartbeat file modify date, you will start noticing that the heartbeat file modify date keeps getting updated every minute, but there is no active browser connection to code server.
wondering if anyone where had this issue ?
The text was updated successfully, but these errors were encountered: