Skip to content

Leftover process python_server.py with 100% after closing VSCode #25620

Closed

Description

Type: Bug

Behaviour

After closing VSCode, a leftover process remains running.

  • This happens locally on my macOS (using about 2.4% of a CPU core):
    /Users/faber/.vscode/extensions/ms-python.python-2025.18.0-darwin-arm64/python_files/python_server.py

  • as well as vis SSH Remote extension on a Linux cluster (using 100% of a CPU core [!]):
    /bin/python /storage/homefs/fb24k097/.vscode-server/extensions/ms-python.python-2025.18.0-linux-x64/python_files/python_server.py

Steps to reproduce:

  1. Open up VSCode
  2. Open a python file
  3. Shift Enter in the python file to start a session and send some commands to the python REPL (e.g. import pprint)
  4. Close VSCode
  5. Check running processes with htop

Diagnostic data

2025-12-03 11:28:43.148 [info] Experiment 'pythonSurveyNotification' is active
2025-12-03 11:28:43.485 [info] Native locator: Refresh started
2025-12-03 11:28:44.296 [info] > pyenv which python
2025-12-03 11:28:44.296 [info] cwd: .
2025-12-03 11:28:46.936 [info] Native locator: Refresh finished in 3452 ms
2025-12-03 11:28:49.055 [info] Starting Pylance language server.
2025-12-03 11:28:49.058 [info] Active interpreter [/storage/homefs/fb24k097/GitHub/fabern/aggregate-ERA5Land-daily]: /storage/homefs/fb24k097/GitHub/fabern/aggregate-ERA5Land-daily/.venv/bin/python
2025-12-03 11:29:00.927 [info] > /bin/python ~/.vscode-server/extensions/ms-python.python-2025.18.0-linux-x64/python_files/normalizeSelection.py

Extension version: 2025.18.0
VS Code version: Code 1.106.3 (bf9252a2fb45be6893dd8870c0bf37e2e1766d61, 2025-11-25T22:28:18.024Z)
OS version: Darwin arm64 24.6.0
Modes:

  • Python version (& distribution if applicable, e.g. Anaconda): 3.13.7.final.0
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): System
  • Value of the python.languageServer setting: Default
User Settings


languageServer: "Pylance"

Installed Extensions
Extension Name Extension Id Version
cmake-tools ms- 1.21.36
copilot-chat Git 0.33.3
cpptools ms- 1.28.3
cpptools-extension-pack ms- 1.3.1
cpptools-themes ms- 2.0.0
debugpy ms- 2025.16.0
fortran-ls han 0.6.2
github-local-actions San 1.2.5
gitlens eam 17.7.1
js-debug ms- 1.105.0
js-debug-companion ms- 1.1.3
language-julia jul 1.158.2
linter-gfortran for 3.4.2025101501
makefile-tools ms- 0.12.17
python ms- 2025.18.0
r REd 2.8.6
r-syntax REd 0.1.3
remote-explorer ms- 0.5.0
remote-ssh ms- 0.120.0
remote-ssh-edit ms- 0.87.0
vscode-js-profile-table ms- 1.0.10
vscode-latex mat 1.3.0
vscode-lldb vad 1.11.5
vscode-peacock joh 4.2.2
vscode-pylance ms- 2025.10.3
vscode-python-envs ms- 1.12.0
System Info
Item Value
CPUs Apple M4 (10 x 2400)
GPU Status 2d_canvas: enabled
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: enabled_on
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 5, 3, 3
Memory (System) 16.00GB (0.18GB free)
Process Argv --crash-reporter-id 08ffa65a-dbb4-4eb7-984b-8800380a22c8
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
pythonvspyt551:31249599
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31334701
aj953862:31281341
nes-set-on:31351930
6abeh943:31336334
envsactivate1:31353494
cloudbuttont:31379625
todos-1:31405332
qwen_all_req:31402696
3efgi100_wstrepl:31403338
trigger-command-fix:31379601
auto_model_enabled:31385282
use-responses-api:31390855
ddidtcf:31399634
je187915:31407605
ec5jj548:31422691
copilot-nes-oct-t:31418199
terminalsuggestenabled:31426255
cmp-ext-treat:31426748
cp_cls_c_966_ss:31426491
defaultvisibility:31426295
expandedtokens:31427242
copilot6169-t1000:31426764
c0683394:31419495
g0h3h215:31426582
478ah919:31426797
ge8j1254_inline_auto_hint_haiku:31426733
b53de340:31426751
a5gib710:31426879
38bie571_auto:31426784

Activity

  1. added
    bugIssue identified by VS Code Team member as probable bug
    and removed
    triage-neededNeeds assignment to the proper sub-team
    on Dec 3, 2025
  2. hutch3232 commented on Dec 6, 2025

    @hutch3232

    I can confirm this is happening to me as well on my M1 MacBook Air. Interestingly, I don't even have the SSH Remote Extension installed. After using the Native REPL, when I close VS Code that same python_server.py script uses 100% of my CPU. If you don't kill the process, and then open VS Code again and repeat the steps, you'll have a second process competing for 100% of CPU. I was wondering why my battery was draining and my laptop was getting very hot. Found the process when running top.

  3. added this to the milestone on Dec 8, 2025
  4. hutch3232 commented on Dec 16, 2025

    @hutch3232

    I looked into this a bit. Haven't made the PR yet because I haven't gotten to do real testing of this yet. https://github.com/microsoft/vscode-python/compare/main...hutch3232:vscode-python:leftover-py-process?expand=1

    This issue is that it's getting stuck in get_headers

    def get_headers():

    It breaks on "" and returns that to handle_response. In that case, content length is 0 so it goes back to get_headers... Repeat.

    My approach raises an error if 0 bytes returned and handles separately. I should be able to test it sometime soon.

  5. removed this from the milestone on Jan 5, 2026
  6. hutch3232 commented on Jan 19, 2026

    @hutch3232

    Anthony Kim (@anthonykim1) João Moreno (@joaomorenoalt) I saw the milestone was removed. Could we please get this issue slated for another milestone? This is a particularly pernicious issue. Thanks!

  7. added a commit that references this issue on Jan 22, 2026
    5970384
  8. anthonykim1 commented on Jan 22, 2026

    @anthonykim1

    Paul (@hutch3232) Yeap, PR in progress, thanks!
    Will let you know once its out in pre-release so we can have folks test this out before it goes into release.

  9. added a commit that references this issue on Jan 22, 2026
    cbcf5e1
  10. anthonykim1 commented on Jan 26, 2026

    @anthonykim1

    Fabian Bernhard (@fabern) Paul (@hutch3232) Could you guys please verify? In the latest pre-release of Python extension.

  11. hutch3232 commented on Jan 26, 2026

    @hutch3232

    Hi Anthony Kim (@anthonykim1), thank you for fixing this! I just tested again and it does not occur in pre-release version.

  12. fabern commented on Jan 26, 2026

    @fabern
    Author

    Great job Anthony Kim (@anthonykim1)!
    This has solved it for me on two different systems.

    I have just tested it with remote-SSH on an Ubuntu 22.04 and 24.04 instance: version 2026.0.0 still had a leftover process, whereas version 2026.1.2026012301 properly terminated the python_server.py.

    Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-replauthor-verification-requestedIssues potentially verifiable by issue authorbugIssue identified by VS Code Team member as probable bugverifiedVerification succeeded

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions