Skip to content

Python extension creates too many zsh processes after update to v2024.10.0 #23820

@duedive

Description

@duedive

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:

  1. Open VS Code with a Python project and Python v2024.10.0 or higher extension.

  2. 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 the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

2024-07-16 10:39:44.598 [info] Experiment 'pythonaa' is active
2024-07-16 10:39:44.598 [info] Experiment 'pythonCreateEnvOnPipInstall' is active
2024-07-16 10:39:44.598 [info] Experiment 'pythonRecommendTensorboardExt' is active
2024-07-16 10:39:44.598 [info] Experiment 'pythonSurveyNotification' is active
2024-07-16 10:39:44.598 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2024-07-16 10:39:44.598 [info] Experiment 'pythonTestAdapter' is active
2024-07-16 10:39:44.598 [error] Reading directory to watch failed [Error: ENOENT: no such file or directory, scandir '/Users/rle/Documents/Softwerk/projects/agoy/agoy-argen/.pixi/envs'
	at Object.readdirSync (node:fs:1515:3)
	at t.readdirSync (node:electron/js2c/node_init:2:11289)
	at /Users/rle/.vscode/extensions/ms-python.python-2024.10.0-darwin-x64/out/client/extension.js:2:574598
	at /Users/rle/.vscode/extensions/ms-python.python-2024.10.0-darwin-x64/out/client/extension.js:2:574789
	at Array.map (<anonymous>)
	at d.initWatchers (/Users/rle/.vscode/extensions/ms-python.python-2024.10.0-darwin-x64/out/client/extension.js:2:574507)
	at async d.ensureWatchersReady (/Users/rle/.vscode/extensions/ms-python.python-2024.10.0-darwin-x64/out/client/extension.js:2:536827)] {
  errno: -2,
  syscall: 'scandir',
  code: 'ENOENT',
  path: '/Users/rle/Documents/Softwerk/projects/agoy/agoy-argen/.pixi/envs'
}
2024-07-16 10:39:44.598 [error] Dir "/Users/rle/Documents/Softwerk/projects/agoy/agoy-argen/.pixi/envs" is not watchable (directory does not exist)
2024-07-16 10:39:44.598 [info] Default formatter is set to ms-python.autopep8 for workspace /Users/rle/Documents/Softwerk/projects/agoy/agoy-argen
2024-07-16 10:39:44.598 [info] Starting Environment refresh
2024-07-16 10:39:44.598 [info] Searching for interpreters in posix paths locator
2024-07-16 10:39:44.598 [info] Searching for pyenv environments
2024-07-16 10:39:44.598 [info] Searching for conda environments
2024-07-16 10:39:44.598 [info] Searching for global virtual environments
2024-07-16 10:39:44.598 [info] Searching for custom virtual environments
2024-07-16 10:39:44.598 [info] pyenv is not installed
2024-07-16 10:39:44.598 [info] Finished searching for pyenv environments: 77 milliseconds
2024-07-16 10:39:44.598 [info] > conda info --json
2024-07-16 10:39:44.598 [info] > pixi --version
2024-07-16 10:39:44.598 [error] [Error: spawn pixi ENOENT
	at ChildProcess._handle.onexit (node:internal/child_process:286:19)
	at onErrorNT (node:internal/child_process:484:16)
	at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn pixi',
  path: 'pixi',
  spawnargs: [ '--version' ]
}
2024-07-16 10:39:44.598 [info] > hatch env show --json
2024-07-16 10:39:44.598 [info] cwd: .
2024-07-16 10:39:44.598 [info] Finished searching for global virtual envs: 419 milliseconds
2024-07-16 10:39:44.598 [info] Finished searching for custom virtual envs: 419 milliseconds
2024-07-16 10:39:44.607 [info] > pyenv which python
2024-07-16 10:39:44.607 [info] cwd: .
2024-07-16 10:39:44.648 [info] Found: /usr/bin/python3 --> /usr/bin/python3
2024-07-16 10:39:44.751 [info] Found: /usr/local/bin/python3 --> /usr/local/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/bin/python3.12
2024-07-16 10:39:44.755 [info] Found: /usr/local/bin/python3.10 --> /usr/local/Cellar/[email protected]/3.10.14/Frameworks/Python.framework/Versions/3.10/bin/python3.10
2024-07-16 10:39:44.759 [info] > /usr/local/bin/python3 -I ~/.vscode/extensions/ms-python.python-2024.10.0-darwin-x64/python_files/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2024.10.0-darwin-x64/python_files/interpreterInfo.py
2024-07-16 10:39:44.767 [info] Found: /usr/local/bin/python3.11 --> /usr/local/Cellar/[email protected]/3.11.9/Frameworks/Python.framework/Versions/3.11/bin/python3.11
2024-07-16 10:39:44.771 [info] > ./.venv/bin/python -I ~/.vscode/extensions/ms-python.python-2024.10.0-darwin-x64/python_files/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2024.10.0-darwin-x64/python_files/interpreterInfo.py
2024-07-16 10:39:44.924 [info] Found: /usr/local/bin/python3.12 --> /usr/local/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/bin/python3.12
2024-07-16 10:39:44.927 [info] Python interpreter path: ./.venv/bin/python
2024-07-16 10:39:46.858 [warning] Shell integration may not be active, environment activated may be overridden by the shell.
2024-07-16 10:39:46.859 [warning] could not find a pixi interpreter for the interpreter at /Users/rle/Documents/Softwerk/projects/agoy/agoy-argen/.venv/bin/python
2024-07-16 10:39:46.964 [info] Found: /usr/local/bin/python3.8 --> /usr/local/Cellar/[email protected]/3.8.19/Frameworks/Python.framework/Versions/3.8/bin/python3.8
2024-07-16 10:39:47.049 [info] Found: /usr/local/bin/python3.9 --> /usr/local/Cellar/[email protected]/3.9.19/Frameworks/Python.framework/Versions/3.9/bin/python3.9
2024-07-16 10:39:47.120 [info] > /usr/bin/python3 -I ~/.vscode/extensions/ms-python.python-2024.10.0-darwin-x64/python_files/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2024.10.0-darwin-x64/python_files/interpreterInfo.py
2024-07-16 10:39:47.193 [info] > . ./.venv/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode/extensions/ms-python.python-2024.10.0-darwin-x64/python_files/printEnvVariables.py
2024-07-16 10:39:47.193 [info] shell: zsh
2024-07-16 10:39:48.154 [info] > /usr/local/bin/python3 ~/.vscode/extensions/ms-python.python-2024.10.0-darwin-x64/python_files/printEnvVariables.py
2024-07-16 10:39:48.154 [info] shell: zsh
2024-07-16 10:39:48.352 [info] > /usr/local/bin/python3.10 -I ~/.vscode/extensions/ms-python.python-2024.10.0-darwin-x64/python_files/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2024.10.0-darwin-x64/python_files/interpreterInfo.py
2024-07-16 10:39:49.192 [info] > /usr/local/bin/python3.11 -I ~/.vscode/extensions/ms-python.python-2024.10.0-darwin-x64/python_files/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2024.10.0-darwin-x64/python_files/interpreterInfo.py
2024-07-16 10:39:49.327 [info] Prepending environment variable PS1 in collection with (.venv)  {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-07-16 10:39:49.327 [info] Prepending environment variable PATH in collection with /Users/rle/.vscode/extensions/ms-python.python-2024.10.0-darwin-x64/python_files/deactivate/zsh:/Users/rle/Documents/Softwerk/projects/agoy/agoy-argen/.venv/bin: {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-07-16 10:39:49.327 [info] Setting environment variable VIRTUAL_ENV in collection to /Users/rle/Documents/Softwerk/projects/agoy/agoy-argen/.venv {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-07-16 10:39:49.327 [info] Setting environment variable VIRTUAL_ENV_PROMPT in collection to (.venv)  {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-07-16 10:39:49.389 [info] Finished searching for interpreters in posix paths locator: 5268 milliseconds
2024-07-16 10:39:49.390 [info] > /usr/local/bin/python3.8 -I ~/.vscode/extensions/ms-python.python-2024.10.0-darwin-x64/python_files/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2024.10.0-darwin-x64/python_files/interpreterInfo.py
2024-07-16 10:39:49.423 [info] > /usr/local/bin/python3.9 -I ~/.vscode/extensions/ms-python.python-2024.10.0-darwin-x64/python_files/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2024.10.0-darwin-x64/python_files/interpreterInfo.py
2024-07-16 10:39:49.525 [info] Environments refresh paths discovered (event): 5413 milliseconds
2024-07-16 10:39:49.526 [info] Environments refresh paths discovered: 5414 milliseconds
2024-07-16 10:39:49.532 [info] Environments refresh finished (event): 5420 milliseconds
2024-07-16 10:39:49.540 [info] Environment refresh took 5429 milliseconds
2024-07-16 10:39:49.606 [info] > /Library/Developer/CommandLineTools/usr/bin/python3 -I ~/.vscode/extensions/ms-python.python-2024.10.0-darwin-x64/python_files/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2024.10.0-darwin-x64/python_files/interpreterInfo.py
2024-07-16 10:39:50.212 [info] Starting Pylance language server.
2024-07-16 10:39:50.331 [info] Send text to terminal: /usr/local/bin/python3 /Users/rle/.vscode/extensions/ms-python.python-2024.10.0-darwin-x64/python_files/printEnvVariablesToFile.py /Users/rle/.vscode/extensions/ms-python.python-2024.10.0-darwin-x64/python_files/deactivate/zsh/envVars.txt

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 version (& distribution if applicable, e.g. Anaconda): 3.12.4
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Venv
  • Value of the python.languageServer setting: Pylance
User Settings


venvPath: "<placeholder>"

languageServer: "Pylance"

Installed Extensions
Extension Name Extension Id Version
.NET Install Tool ms-dotnettools.vscode-dotnet-runtime 2.0.9
Amazon Q amazonwebservices.amazon-q-vscode 1.15.0
autoDocstring - Python Docstring Generator njpwerner.autodocstring 0.6.1
autopep8 ms-python.autopep8 2024.0.0
AWS Toolkit amazonwebservices.aws-toolkit-vscode 3.14.0
Better Comments aaron-bond.better-comments 3.0.2
Better Solarized ginfuru.ginfuru-better-solarized-dark-theme 0.10.9
Braver's Solarized Braver.vscode-solarized 2.0.4
C/C++ ms-vscode.cpptools 1.20.5
C# ms-dotnettools.csharp 2.34.12
Checkstyle for Java shengchen.vscode-checkstyle 1.4.2
Code Spell Checker streetsidesoftware.code-spell-checker 3.0.1
CodeMetrics kisstkondoros.vscode-codemetrics 1.26.1
CodeWhisperer for command line amazonwebservices.codewhisperer-for-command-line-companion 0.1.0
Comment Anchors ExodiusStudios.comment-anchors 1.10.4
Cordova Tools msjsdiag.cordova-tools 2.7.0
Debugger for Java vscjava.vscode-java-debug 0.58.0
Dependency Graph Viewer Antarpreet.dependency-graph-viewer 0.0.8
Deploy (Reloaded) mkloubert.vscode-deploy-reloaded 0.89.0
Dev Containers ms-vscode-remote.remote-containers 0.375.1
Docker ms-azuretools.vscode-docker 1.29.1
EBNF Tools igochkov.vscode-ebnf 1.3.1
ESLint dbaeumer.vscode-eslint 3.0.10
Excel Viewer GrapeCity.gc-excelviewer 4.2.59
Extension Pack for Java vscjava.vscode-java-pack 0.27.0
GitLens — Git supercharged eamodio.gitlens 15.2.0
HashiCorp Terraform hashicorp.terraform 2.32.0
IntelliCode VisualStudioExptTeam.vscodeintellicode 1.3.1
isort ms-python.isort 2023.10.1
Java Project Explorer yaozheng.vscode-java-copilot 0.1.4
JavaScript Debugger ms-vscode.js-debug 1.91.0
JavaScript Debugger Companion Extension ms-vscode.js-debug-companion 1.1.2
JS Complexity Analysis TomiTurtiainen.js-complexity-analysis 2.0.0
Jupyter ms-toolsai.jupyter 2024.6.0
Jupyter Cell Tags ms-toolsai.vscode-jupyter-cell-tags 0.1.9
Jupyter Keymap ms-toolsai.jupyter-keymap 1.1.2
Jupyter Notebook Renderers ms-toolsai.jupyter-renderers 1.0.18
Jupyter Slide Show ms-toolsai.vscode-jupyter-slideshow 0.1.6
Language Support for Java(TM) by Red Hat redhat.java 1.32.0
LaTeX language support torn4dom4n.latex-support 3.10.0
LaTeX Workshop James-Yu.latex-workshop 10.1.0
Markdown PDF yzane.markdown-pdf 1.5.0
Markdown Preview Mermaid Support bierner.markdown-mermaid 1.23.1
Markdown+Math goessner.mdmath 2.7.4
markdownlint DavidAnson.vscode-markdownlint 0.55.0
Matlab Unofficial Gimly81.matlab 3.0.2
matlab-formatter AffenWiesel.matlab-formatter 2.11.0
Maven for Java vscjava.vscode-maven 0.44.0
php cs fixer junstyle.php-cs-fixer 0.3.13
PHP Debug xdebug.php-debug 1.35.0
PHP Extension Pack xdebug.php-pack 1.0.3
PHP IntelliSense felixfbecker.php-intellisense 2.3.14
PHP IntelliSense zobo.php-intellisense 1.3.3
Prettier ESLint rvest.vs-code-prettier-eslint 6.0.0
Project Manager for Java vscjava.vscode-java-dependency 0.23.7
Pylance ms-python.vscode-pylance 2024.7.1
Python ms-python.python 2024.8.1
Python Debugger ms-python.debugpy 2024.8.0
Rainbow CSV mechatroner.rainbow-csv 3.12.0
SonarLint SonarSource.sonarlint-vscode 4.7.0
Swedish - Code Spell Checker streetsidesoftware.code-spell-checker-swedish 1.3.1
Table Visualizer for JavaScript Profiles ms-vscode.vscode-js-profile-table 1.0.9
Test Runner for Java vscjava.vscode-java-test 0.41.1
XML Tools DotJoshJohnson.xml 2.5.1
System Info
Item Value
CPUs Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz (8 x 2300)
GPU Status 2d_canvas: enabled
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
Load (avg) 21, 159, 137
Memory (System) 16.00GB (0.13GB free)
Process Argv --crash-reporter-id 20def760-1166-41f9-8c27-dbc511f7b9ad
Screen Reader yes
VM 0%
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscorecescf:30445987
vscod805:30301674
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
a9j8j154:30646983
962ge761:30959799
pythongtdpath:30769146
welcomedialogc:30910334
pythonnoceb:30805159
asynctok:30898717
pythonregdiag2:30936856
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
accentitlementst:30995554
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
chatpanelt:31048053
dsvsc021:30996838
9c06g630:31013171
pythoncenvpt:31062603
a69g1124:31058053
dvdeprecation:31068756
dwnewjupyter:31046869
impr_priority:31094925
pythonrstrctxt:31093869
hdi1a554:31097393

Metadata

Metadata

Assignees

Labels

area-terminalbugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions