diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-08-08 15:49:13 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2019-08-08 15:49:13 +0200 |
commit | 1d750e058738f92b378a6bfbdadb025d1463c243 (patch) | |
tree | 798ac85630df11dac35884c7c6c5bdd6be376bea /src/libstore/local-store.cc | |
parent | 336afe4d5fe374569c2b13d2db90caac663573b3 (diff) | |
parent | 05a10dd835923092b54fcad2276d54bf164c1b7f (diff) |
Merge remote-tracking branch 'origin/master' into flakes
Diffstat (limited to 'src/libstore/local-store.cc')
-rw-r--r-- | src/libstore/local-store.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index f39c73b23..a9399130c 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -1203,7 +1203,8 @@ bool LocalStore::verifyStore(bool checkContents, RepairFlag repair) bool errors = false; - /* Acquire the global GC lock to prevent a garbage collection. */ + /* Acquire the global GC lock to get a consistent snapshot of + existing and valid paths. */ AutoCloseFD fdGCLock = openGCLock(ltWrite); PathSet store; @@ -1214,13 +1215,11 @@ bool LocalStore::verifyStore(bool checkContents, RepairFlag repair) PathSet validPaths2 = queryAllValidPaths(), validPaths, done; + fdGCLock = -1; + for (auto & i : validPaths2) verifyPath(i, store, done, validPaths, repair, errors); - /* Release the GC lock so that checking content hashes (which can - take ages) doesn't block the GC or builds. */ - fdGCLock = -1; - /* Optionally, check the content hashes (slow). */ if (checkContents) { printInfo("checking hashes..."); |