mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 00:08:07 +02:00
Merge pull request #7521 from ncfavier/migration-deadlock
Release shared lock before acquiring exclusive lock
This commit is contained in:
commit
e8a3e58171
1 changed files with 2 additions and 0 deletions
|
@ -91,6 +91,7 @@ void migrateCASchema(SQLite& db, Path schemaPath, AutoCloseFD& lockFd)
|
||||||
|
|
||||||
if (!lockFile(lockFd.get(), ltWrite, false)) {
|
if (!lockFile(lockFd.get(), ltWrite, false)) {
|
||||||
printInfo("waiting for exclusive access to the Nix store for ca drvs...");
|
printInfo("waiting for exclusive access to the Nix store for ca drvs...");
|
||||||
|
lockFile(lockFd.get(), ltNone, false); // We have acquired a shared lock; release it to prevent deadlocks
|
||||||
lockFile(lockFd.get(), ltWrite, true);
|
lockFile(lockFd.get(), ltWrite, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -299,6 +300,7 @@ LocalStore::LocalStore(const Params & params)
|
||||||
|
|
||||||
if (!lockFile(globalLock.get(), ltWrite, false)) {
|
if (!lockFile(globalLock.get(), ltWrite, false)) {
|
||||||
printInfo("waiting for exclusive access to the Nix store...");
|
printInfo("waiting for exclusive access to the Nix store...");
|
||||||
|
lockFile(globalLock.get(), ltNone, false); // We have acquired a shared lock; release it to prevent deadlocks
|
||||||
lockFile(globalLock.get(), ltWrite, true);
|
lockFile(globalLock.get(), ltWrite, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue