mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-02 04:48:18 +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
|
|
@ -67,7 +67,8 @@ impl GitResolver {
|
|||
let _lock = LockedFile::acquire(
|
||||
lock_dir.join(cache_key::cache_digest(&repository_url)),
|
||||
&repository_url,
|
||||
)?;
|
||||
)
|
||||
.await?;
|
||||
|
||||
// Fetch the Git repository.
|
||||
let source = if let Some(reporter) = reporter {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue