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

Hung up remote session keeps running at 100% CPU #1289

Open
pkese opened this issue May 1, 2024 · 4 comments
Open

Hung up remote session keeps running at 100% CPU #1289

pkese opened this issue May 1, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@pkese
Copy link

pkese commented May 1, 2024

Summary

It's hogging up the CPU.

image

Extension version

v24.4.0

VS Code version

1.88.1

Ansible Version

ansible [core 2.14.9]
  config file = None
  configured module search path = ['/home/peter/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/peter/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.11.6 (main, Oct  8 2023, 05:06:43) [GCC 13.2.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

OS / Environment

Ubuntu 23.10

Relevant log output

No response

@pkese pkese added bug Something isn't working new labels May 1, 2024
@ssbarnea ssbarnea removed the new label May 1, 2024
@ssbarnea
Copy link
Member

ssbarnea commented May 1, 2024

Unless you can provide a way to reproduce the problem we will have to close this one due to not being able reproduce.

I suspect it might have something to do with the repository you opened or your specific configuration.

I see that code is installed in an uncommon location and you also failed to mention operating system and version.

Are you opening the code from a network drive or a volume mount that is not native?

@pkese
Copy link
Author

pkese commented May 1, 2024

It's just a normal apt-get install code on Ubuntu 23.10.

But thanks for the hint about code is installed in an uncommon location (I didn't notice that).

It was a remote ssh session that got a hang-up from remote.

So to reproduce:

  • install Remote development on some client machine (I do remote from my laptop into my home desktop computer)
  • open a remote session to the machine with an Ansible project
  • the remote session will then automatically install a separate copy of vscode to /usr/share/code (that's why the unusual installation path above)
  • once you have remote session established, you an install vscode extensions on either local or remote machine, so install vscode-ansible extension on remote machine
  • hanging up the remote connection (in my case, putting laptop to sleep) leads to the fore mentioned issue. The 100% CPU case may not happen every time, but in a few retries, it will eventually happen.

Maybe there's some documentation in the vscode community about that.
I recall having similar problems with remote Jupyter notebooks, a while ago, but eventually the Juypter folks managed to fix that issue.

@pkese pkese changed the title Keeps using 100% CPU Hung up remote session keeps running at 100% CPU May 1, 2024
@djobin
Copy link

djobin commented May 24, 2024

We've also experienced this issue last week. Two users remotely connected to a RHEL server, using the Ansible extension had their redhat.ansible-24.4.0 process using all server's CPU.

When I asked them what they were doing, they told me that they weren't even working on Code at that moment.
I had to kill thoses processes because even after "Closing remote connection" and "Kill Vs Code server on remote" .. the processes would still be running at 100%.

@ganeshrn
Copy link
Member

ganeshrn commented Jul 26, 2024

@pkese @djobin Can you please share the ansible extension settings and size of the workspace folder opened in editor, this might help to narrow down the problem.

Some of the resource intensive operation that I think of is

  • Running ansible-lint with execution environment enabled

  • Lightspeed AI setting enabled and a large workspace opened in the editor. When a new workspace is opened in editor the extension parses all the files in workspace to identify Ansible files and store the variables and role names in memory which acts as additional context for AI completion requests.

Also for debugging you can monitor the extension logs by looking as Ansible Support and Ansible Lightspeed output channels after turning on the verbose logging.

Screenshot 2024-07-26 at 12 21 49 PM

Additonally in case Lightspeed is enabled you can monitor the additional logs by opening Developer: Toggle Developer Tools from command palette.

Screenshot 2024-07-26 at 12 28 18 PM Screenshot 2024-07-26 at 12 29 24 PM

cc @ssbarnea @TamiTakamiya @goneri

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

4 participants