Title: Jedi: overlapping language server restarts leak Jedi processes and completion hangs · Issue #26296 · microsoft/vscode-python · GitHub
Open Graph Title: Jedi: overlapping language server restarts leak Jedi processes and completion hangs · Issue #26296 · microsoft/vscode-python
X Title: Jedi: overlapping language server restarts leak Jedi processes and completion hangs · Issue #26296 · microsoft/vscode-python
Description: Type: Bug Behaviour With Jedi as language server (python.languageServer: "Jedi", or "Default" without Pylance), changing the active interpreter and restarting the language server in quick succession leaves extra run-jedi-language-server....
Open Graph Description: Type: Bug Behaviour With Jedi as language server (python.languageServer: "Jedi", or "Default" without Pylance), changing the active interpreter and restarting the language server in quick successio...
X Description: Type: Bug Behaviour With Jedi as language server (python.languageServer: "Jedi", or "Default" without Pylance), changing the active interpreter and restarting the language serve...
Opengraph URL: https://github.com/microsoft/vscode-python/issues/26296
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Jedi: overlapping language server restarts leak Jedi processes and completion hangs","articleBody":"## Type: Bug\n\n## Behaviour\n\nWith Jedi as language server (`python.languageServer: \"Jedi\"`, or `\"Default\"` without Pylance), changing the\nactive interpreter and restarting the language server in quick succession leaves extra\n`run-jedi-language-server.py` processes running. Completion in Python files then hangs (the suggest widget\nstays at \"Loading...\" / no results) until the window is reloaded.\n\nEach interpreter change stops the Jedi server and starts a new one with the new interpreter. When the next\nstop or restart arrives while a start is still in progress, the server that is being started is not stopped\nand stays running without being connected/tracked.\n\nA related symptom: when `python.analysis.restartLanguageServer` runs before the extension has started Jedi\nfor the first time (e.g. while it is still resolving the interpreter at startup), it starts a server that is\nnever connected. Completion then shows nothing in the whole window until a reload.\n\nAlso, the Jedi handler of `python.analysis.restartLanguageServer` does not return the restart promise, so\n`await vscode.commands.executeCommand('python.analysis.restartLanguageServer')` resolves immediately. Callers\ntherefore cannot wait for the restart to finish to avoid overlapping it.\n\n### Expected\n\n- At any time at most one Jedi server process per workspace folder, regardless of how quickly interpreter\n changes and restarts follow each other (a pending start is cancelled/stopped, or requests are serialized).\n- `python.analysis.restartLanguageServer` resolves after the new server is running, as with Pylance.\n\n### Actual\n\n- After \"switch away, switch back, restart\" sequences, more than one `run-jedi-language-server.py` process\n runs for one workspace folder (expected: 1).\n- Completion hangs until `Developer: Reload Window`.\n\n## Steps to reproduce\n\n1. Settings: `\"python.languageServer\": \"Jedi\"`. Workspace with a virtual environment `.venv` and at least one\n other interpreter available (e.g. a global Python).\n2. Open a `.py` file and wait until completion works.\n3. Run the following sequence of calls from an extension. We hit this through our own extension, which\n switches the interpreter away and back so that language servers pick up changed `.pth` files; the snippet\n shows the calls it makes (it waits up to 1 s between the two switches until the venv's `python.exe` is\n released):\n\n ```ts\n import { PythonExtension } from '@vscode/python-extension';\n\n const api = await PythonExtension.api();\n const folder = vscode.workspace.workspaceFolders![0];\n await api.environments.updateActiveEnvironmentPath(otherPythonPath, folder);\n await api.environments.updateActiveEnvironmentPath(venvPythonPath, folder);\n await vscode.commands.executeCommand('python.analysis.restartLanguageServer');\n ```\n\n Doing the same by hand (Python: Select Interpreter twice quickly, then Python: Restart Language Server)\n may also work, but is timing dependent.\n4. Count the Jedi processes (Windows PowerShell):\n\n ```powershell\n Get-CimInstance Win32_Process -Filter \"Name='python.exe'\" |\n Where-Object CommandLine -match 'run-jedi-language-server' |\n Select-Object ProcessId, CommandLine\n ```\n\n5. Try completion in the open `.py` file.\n\n## Diagnostic data\n\n- Python extension version: 2026.10.0 (ms-python.python-2026.10.0-win32-x64)\n- Python Environments extension: 1.42.0\n- VS Code version: 1.127.0 (4fe60c8b1cdac1c4c174f2fb180d0d758272d713), x64\n- OS: Windows 11 Enterprise 10.0.22631\n- Language server: Jedi (Pylance not installed / `python.languageServer: \"Jedi\"`)\n- Python version: 3.14.5\n\n## Notes\n\nWe have only seen this with Jedi. Pylance does not run inside the selected interpreter, so an interpreter\nchange does not replace its process.\n","author":{"url":"https://github.com/AndreasReichel","@type":"Person","name":"AndreasReichel"},"datePublished":"2026-11-16T08:42:40Z","url":"https://github.com/microsoft/vscode-python/issues/26296"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:68b4d65e-7b4d-40cb-3635-995ff3218889 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 96E8:332DCA:216FD1:2EBF80:6AFD70AF |
| html-safe-nonce | d06f134c6d7da2335e42b989112522cdd4cd5e212a7d58423b111b4ed253840d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NkU4OjMzMkRDQToyMTZGRDE6MkVCRjgwOjZBRkQ3MEFGIiwidmlzaXRvcl9pZCI6Ijg2OTgxOTI1ODU5NzUyMzA2MzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f9c1174e71b182441ebee8036ae9c4476dce15e7be091d2fb3811fcc1ba48f7c |
| hovercard-subject-tag | issue:6417504011 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/vscode-python/26296/issue_layout |
| twitter:image | https://opengraph.githubassets.com/31ba3d5fc9528e3b90539309b4474f9924ba36563cfb27306833333e42c09545/microsoft/vscode-python/issues/26296 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/31ba3d5fc9528e3b90539309b4474f9924ba36563cfb27306833333e42c09545/microsoft/vscode-python/issues/26296 |
| og:image:alt | Type: Bug Behaviour With Jedi as language server (python.languageServer: "Jedi", or "Default" without Pylance), changing the active interpreter and restarting the language server in quick successio... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | AndreasReichel |
| hostname | github.com |
| expected-hostname | github.com |
| None | e54006cf2b96d1ac260960edd10003132911469ccd1ec99c9803119fe2a4e032 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/vscode-python git https://github.com/microsoft/vscode-python.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 106462765 |
| octolytics-dimension-repository_nwo | microsoft/vscode-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 49946255 |
| octolytics-dimension-repository_parent_nwo | DonJayamanne/pythonVSCode |
| octolytics-dimension-repository_network_root_id | 49946255 |
| octolytics-dimension-repository_network_root_nwo | DonJayamanne/pythonVSCode |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5be0bf2b8cf26f8897d31e6bc3c232d328b12a54 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width