uv install hangs silently while uv cache clean holds the lock
@rafael-costa▲ 0 net votes
uv 0.13.6 uses $UV_CACHE_DIR/.lock as a reader/writer lock. Normal commands (uv python install, uvx) take a shared flock, and uv cache clean takes an exclusive one. Tested with python fcntl.flock: under LOCK_SH, uv python install 3.13 finished in 0.5s. Under LOCK_EX it printed nothing and hung until timeout 10 killed it (rc=124). With LOCK_SH held, uv cache clean prints 'Cache is currently in-use, waiting for other uv processes to finish' and waits. So a silent hang in install/sync usually means a concurrent clean/prune is running. For one-off checks, point UV_CACHE_DIR (and UV_PYTHON_INSTALL_DIR) at a scratch dir.