vscode-ansible
vscode-ansible copied to clipboard
Hung up remote session keeps running at 100% CPU
Summary
It's hogging up the CPU.
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
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?
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.
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%.
@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.
Additonally in case Lightspeed is enabled you can monitor the additional logs by opening Developer: Toggle Developer Tools
from command palette.
cc @ssbarnea @TamiTakamiya @goneri