mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-21 07:42:05 +00:00
Avoid deadlocks when multiple uv processes lock resources (#6790)
This is achieved by updating the `LockedFile::acquire` API to be async —
as in some cases we were attempting to acquire the lock synchronously,
i.e., without yielding, which blocked the runtime.
Closes https://github.com/astral-sh/uv/issues/6691 — I tested with the
reproduction there and a local release build and no longer reproduce the
deadlock with these changes.
Some additional context in the [internal Discord
thread](1278478941
)
This commit is contained in:
parent
4f5356ed55
commit
e3d5d3d26d
19 changed files with 58 additions and 39 deletions
|
@ -124,7 +124,7 @@ impl PythonInstallation {
|
|||
let installations = ManagedPythonInstallations::from_settings()?.init()?;
|
||||
let installations_dir = installations.root();
|
||||
let cache_dir = installations.cache();
|
||||
let _lock = installations.acquire_lock()?;
|
||||
let _lock = installations.lock().await?;
|
||||
|
||||
let download = ManagedPythonDownload::from_request(&request)?;
|
||||
let client = client_builder.build();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue