Skip to content

conda environments requiring admin rights cause 100 percent CPU usage on Win #9473

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

Closed
melund opened this issue Jan 9, 2020 · 4 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@melund
Copy link

melund commented Jan 9, 2020

Environment data

  • VS Code version: 1.41.1
  • Extension version: 2020.1.57204
  • OS and version: Windows_NT x64 10.0.19041
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7 Anaconda
  • Type of virtual environment used: conda

Expected behaviour

VS code should start up fast and detect conda environments on the machine.

Actual behaviour

Some python processes uses 100 % CPU and hangs when VS code starts.

The hanging processes are using conda run to query conda environments info using ms-python.python-2020.1.57204\pythonFiles\interpreterInfo.py.

This process hangs if the conda-environments are in locations which require admin rights.

The problem is caused by a bug conda-run conda/conda#9574 which creates temporary files directly in the environments instead of the tempfile folders. This again triggers a long standing Python bug in the tempfile module.

Steps to reproduce:

  1. Create an environment
  2. Move a environment to a place requiring admin rights E.g. "c:/conda-env"
  3. Start VS code and wait for Python extension to query the environment with conda run
@melund melund added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels Jan 9, 2020
@uzhao
Copy link

uzhao commented Jan 9, 2020

Same problem on Ubuntu. No response with conda run

@melund
Copy link
Author

melund commented Jan 9, 2020

Ok. There could be similar problems with linux since "conda run" choses to put its temp files directly in the prefix of the installation.

But it wouldn't cause the 100% CPU issue. That is a Windows python bug.

@karthiknadig
Copy link
Member

Issue #9490 should address that since it removes conda run usage, for now.

@karthiknadig karthiknadig self-assigned this Jan 9, 2020
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Jan 9, 2020
@melund
Copy link
Author

melund commented Jan 9, 2020

Great. Thanks for the good work.

@melund melund closed this as completed Jan 9, 2020
@ghost ghost removed the triage label Jan 9, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Jan 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

3 participants