-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Python extension creates too many zsh processes after update to v2024.10.0 #23820
Comments
@duedive Can you capture the command line of these processes? |
It is nothing I run myself, but when trying to capture the command line of the processes (as you suggested) I found the issue based on the open files and ports information from Activity Monitor. All processes I checked show this (below) which seems to create an endless loop of activating and deactivating virtual environments:
The zsh processes have a bash process as parent showing:
When I remove/disable the
I do not understand why this works with Python plugin v2024.8.1 and fails with v2024.10.0. Maybe something changed in the loading of the virtual environments process or how VSCode creates terminals. Anyway it seems it is an issue specific to my environment and I have now a work around by skipping to run the virtual environment activation in my plug-in if the terminal is started by VSCode. |
This has been the culprit for my issues. Activity Monitor shows batches of |
I have the same issues. Downgrading to v2024.8.1 fixes the problem for me, too. |
@deanq @zakaryan2004 are you also using Oh my zsh with some plug-in to load virtual environments, or its a different cause for you? (just curious) |
Actually, yes. I have oh my zsh and a plugin that activates virtual environments automatically. |
Yes. Exactly zsh with virtualenv where it auto loads when cd-ing to a
directory where venv folder exists. Typical setup like OP.
…On Sat, Jul 20, 2024 at 11:54 PM Gegham Zakaryan ***@***.***> wrote:
@deanq <https://github.com/deanq> @zakaryan2004
<https://github.com/zakaryan2004> are you also using Oh my zsh with some
plug-in to load virtual environments, or its a different cause for you?
(just curious)
Actually, yes. I have oh my zsh and a plugin that activates virtual
environments automatically.
—
Reply to this email directly, view it on GitHub
<#23820 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIWU6CT7IFTATG3T6LEM2TZNNLLPAVCNFSM6AAAAABK6DWZVSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBRGUYDAOJSG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Ok, then you might have a plug-in similar to the following in a file like: ~/.oh-my-zsh/custom/plugins/virtualenv-autoload/virtualenv-autoload.plugin.zsh
Adding lines 7-9 and 20 solved the issue for me. I basically encapsulated the original plug-in to only run if it is not having vscode as terminal. Maybe you can apply a similar solution to your plug-in. Good luck. This could still be only a work around, and there might be some issue with the Python plugin, since above worked without problems before update to v2024.10.x. |
This also fixes my issue with VScode + zsh + auto venv. What behaviour was changed in v2024.10.0 that causes this effect? |
Amazing, so grateful that I found this issue. Have the exact same setup and VS code have been taking up all my ram for the past few months 😄 |
I guess I'll have to keep pegging the installed version to old ones until this is fixed. |
I had the same issue and duedive's solution led me to the same. Thanks so much! I had OOM issues using vscode over SSH to vscode-server on my linux desktop. 1000's of zsh shells running deactivate! I use oh-my-zsh with a virtualenv plugin, see edits I made here
|
Type: Bug
Behaviour
After update (automatically) to v2024.10.0 of the Python extension opening any of my existing Python projects starts about 2000 zsh and bash processes (going from ca 600 processes to 2500-3000 processes in total). After wich working with the computer becomes very slow.
Reverting to Python extension v2024.8.1 solved the issue. The issue does also exist with the V2024.11.x pre-view version.
The zsh processes get killed very slowly when closing VS Code. Doing
sudo pkill -a zsh bash
speeds it up.I am using latest Mac OS (14.5, Intel) with zsh 5.9 and
Oh my Zsh
. Python projects using a virtual environment with Python 3.12 or 3.9.Just starting VS Code without a Python project, does not cause the problem.
Closing the terminal windows does not have an effect (new processes still get started).
Starting new zsh processes stops around 3000 open processes, when some system limit for open processes is reached. At that point I usually cannot open a new Mac Terminal window any longer.
Process creation also stops after closing VS Code.
Steps to reproduce:
Open VS Code with a Python project and Python v2024.10.0 or higher extension.
There are a number of errors in the Output for Python (see below) that pixi cannot be found, but I am not using this, so its probably ok? In the output with version Python v2024.8.1, there are no errors.
Diagnostic data
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Extension version: 2024.8.1
VS Code version: Code 1.91.1 (f1e16e1e6214d7c44d078b1f0607b2388f29d729, 2024-07-09T22:07:54.982Z)
OS version: Darwin x64 23.5.0
Modes:
python.languageServer
setting: PylanceUser Settings
Installed Extensions
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: