Skip to content
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

exit of vscode remote containter leaves processes with high cpu in container #6543

Closed
xgdgsc opened this issue Apr 1, 2022 · 16 comments · Fixed by microsoft/vscode#170305
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers verified Verification succeeded
Milestone

Comments

@xgdgsc
Copy link

xgdgsc commented Apr 1, 2022

  • VSCode Version: 1.66.0
  • Local OS Version: Ubuntu 20.04
  • Remote OS Version: CentOS 7.6
  • Remote Extension/Connection Type: Docker
  • Logs:

Steps to Reproduce:

  1. Run vscode remote container
  2. exit vscode

Does this issue occur when you try this locally?: No
Does this issue occur when you try this locally and all extensions are disabled?: No

Full cmd line of high cpu process:

/root/.vscode-server/bin/e18005f0f1b33c29e81d732535d8c0e47cafb0b5/node /root/.vscode-server/bin/e18005f0f1b33c29e81d732535d8c0e47cafb0b5/out/server-main.js --log debug --force-disable-user-env --server-data-dir /root/.vscode-server --use-host-proxy --accept-server-license-terms --host 127.0.0.1 --port 0 --connection-token-file /root/.vscode-server/data/Machine/.connection-token-e18005f0f1b33c29e81d732535d8c0e47cafb0b5 --extensions-download-dir /root/.vscode-server/extensionsCache --start-server --disable-websocket-compression

There are 2 such processes, each using one core of CPU to its full. One with 2M/s memory increase, another with 0.2M/s memory usage increase. I only noticed this after today 1.66.0 vscode update. Not sure if it occurred before.

@github-actions github-actions bot added the containers Issue in vscode-remote containers label Apr 1, 2022
@zydou
Copy link

zydou commented Apr 1, 2022

I got this too.

@chrmarti
Copy link
Contributor

chrmarti commented Apr 1, 2022

Also when reloading the window.

@alexdima This seems to be a variation of the broken stdio we looked at:
image

@chrmarti chrmarti added the bug Issue identified by VS Code Team member as probable bug label Apr 1, 2022
@chrmarti
Copy link
Contributor

chrmarti commented Apr 4, 2022

Looking into using docker exec to start the server as that seems to be more tolerant towards the host process going away.

@chrmarti
Copy link
Contributor

chrmarti commented Apr 4, 2022

Fixed in Remote-Containers as #6547. It might still make sense to investigate on the server's side.

#6547 (comment) mentions something similar with Remote-SSH. (Reproduced only 1 out of 3 times I tried, so maybe it is actually a different issue.) /cc @tanhakabir

@tanhakabir
Copy link

@chrmarti the linked issue looks like an issue with connecting. The error logs comes from OpenSSH and we don't actually get to the VS Code Server yet. But I'll try to reproduce and investigate if something similar to this issue is happening on my end.

@chrmarti
Copy link
Contributor

chrmarti commented Apr 4, 2022

@tanhakabir Some guessing on my side: It might be caused by the VS Code Server consuming the CPU when this issue hits. I have seen it consume 100% CPU (but only once) after triggering reconnection by terminating the SSH client. I was still able to connect, but that might depend on how many CPUs the SSH server has available.

@tanhakabir
Copy link

@chrmarti what are the repro steps you're using to repro this issue?

Also do you have a link to track and learn more about this issue? #6543 (comment)

I'm also not familiar with docker exec. What does it do and how does it fix the issue of the VS Code Server seeming to use too much CPU?

@alexdima
Copy link
Member

alexdima commented Apr 4, 2022

It might still make sense to investigate on the server's side.

@chrmarti What are the repro steps? Just reloading the window again?

@chrmarti
Copy link
Contributor

chrmarti commented Apr 5, 2022

@alexdima With Remote-Containers 0.231.2 a window reload triggers the problem.

With Remote-SSH I think once saw it in a reconnection scenario (killing the SSH client locally to trigger reconnection). A window reload did not trigger it.

@tanhakabir docker exec is a Docker command to run an arbitrary command in a container. Using that seems to work around the problem for Remote-Containers (previously I was using an existing connection to the container which has lower latency than a separate docker exec).

@thomas-qualia
Copy link

thomas-qualia commented Apr 5, 2022

The Remote SSH problem is happening to me every day. It just started after one of the recent VS Code updates. It happens consistently after a period of inactivity (like stepping away from my mac for a bit). My fix right now is to cmd+shift+p and 'Developer: Reload Window'.

Let me know if there's any more information that would be helpful that I can gather beyond what I already posted in #6547 (comment)

@alexdima alexdima added the candidate Issue identified as probable candidate for fixing in the next release label Apr 6, 2022
@alexdima alexdima added this to the March 2022 Recovery milestone Apr 6, 2022
@dbaeumer dbaeumer removed the candidate Issue identified as probable candidate for fixing in the next release label Apr 6, 2022
sourcegraph-bot pushed a commit to sgtest/megarepo that referenced this issue Apr 28, 2022
…expected error handler (which has async endless loop protection) instead of using the console in the SIGPIPE handler

Commit: ed63059a4752d031535182b1d6eb37719483fbbd
@connor4312
Copy link
Member

I don't hit this on Insiders, but also didn't reproduce on stable. Are there additional verification steps needed for this?

@connor4312 connor4312 added the verification-steps-needed Steps to verify are needed for verification label Apr 29, 2022
@alexdima
Copy link
Member

alexdima commented May 2, 2022

I think this only reproduces with Remote-Containers 0.231.2 and is visible after doing top. @chrmarti Could you please try to verify this?

aeschli pushed a commit to microsoft/vscode that referenced this issue May 2, 2022
… error handler (which has async endless loop protection) instead of using the console in the SIGPIPE handler
@chrmarti
Copy link
Contributor

chrmarti commented May 4, 2022

@alexdima Reloading the window with 0.231.2 makes the server-main.js process go to 100% CPU:

/vscode/vscode-server-insiders/bin/linux-x64/3159d61ccf5150764f7742f098d76872e3114dcb-insider/node /vscode/vscode-server-insiders/bin/linux-x64/3159d61ccf5150764f7742f098d76872e3114dcb-insider/out/server-main.js --log trace --force-disable-user-env --server-data-dir /home/vscode/.vscode-server-insiders --use-host-proxy --disable-telemetry --accept-server-license-terms --host 127.0.0.1 --port 0 --connection-token-file /home/vscode/.vscode-server-insiders/data/Machine/.connection-token-3159d61ccf5150764f7742f098d76872e3114dcb-insider --extensions-download-dir /home/vscode/.vscode-server-insiders/extensionsCache --install-extension ms-vscode.powershell --start-server --disable-websocket-compression

This does not happen with 0.231.6, presumably due to the workaround I added in 0.231.3.

This is with:

Version: 1.67.0-insider
Commit: 3159d61ccf5150764f7742f098d76872e3114dcb
Date: 2022-05-04T00:06:17.462Z
Electron: 17.4.1
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Darwin x64 20.6.0

@alexdima alexdima reopened this May 4, 2022
@alexdima alexdima modified the milestones: April 2022, May 2022 May 4, 2022
@chrmarti chrmarti modified the milestones: May 2022, On Deck Jun 2, 2022
@alexdima
Copy link
Member

I'll close this one given we have put in place a workaround in the extension. @chrmarti Please reopen if we should continue looking into this.

@alexdima alexdima closed this as not planned Won't fix, can't repro, duplicate, stale Oct 25, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2022
@connor4312 connor4312 reopened this Dec 30, 2022
@connor4312
Copy link
Member

Repro steps: microsoft/vscode#168194 (comment)

@TylerLeonhardt
Copy link
Member

TylerLeonhardt commented Jan 27, 2023

Verification steps from @connor4312:

it shouldn’t fail to connect.

@TylerLeonhardt TylerLeonhardt added the verified Verification succeeded label Jan 27, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants