Skip to content

fix: fix deadlocks caused by uv_venv_auto #4900

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

risu729
Copy link
Contributor

@risu729 risu729 commented Apr 22, 2025

Fixes #4600, but still in WIP.

@risu729
Copy link
Contributor Author

risu729 commented Apr 23, 2025

Note:

The root cause of this issue lies in uv_venv_auto attempting to resolve the path to uv, which introduces a cyclic dependency:

toolset → ($npm/go dep env) → config → (uv path) → toolset

This cycle leads to a deadlock in LazyLock or OnceCell due to reentrant initialisation, where an item tries to access itself during its own initialisation.

Ideally, the correct fix would involve resolving the reentrancy issue directly.
However, since that seems complex, I'm trying to workaround by bypassing LazyLock or OnceCell during their initialization phase.
It means returning None or default values instead of trying to init, thus avoiding the deadlock.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

npm backend hangs when used with python.uv_venv_auto = true
1 participant