add a comment about checkSaneLock
See commit 8c2dd7d8ee
for original
introduction of it, but needing to spelunk that far back to understand
the code is not good.
This commit is contained in:
parent
55bfa414b3
commit
a3cdff3fd5
1 changed files with 5 additions and 0 deletions
|
@ -151,6 +151,11 @@ runTransfer' ignorelock t afile stalldetection retrydecider transferaction =
|
|||
createAnnexDirectory $ P.takeDirectory lck
|
||||
tryLockExclusive (Just mode) lck >>= \case
|
||||
Nothing -> return (Nothing, True)
|
||||
-- Since the lock file is removed in cleanup,
|
||||
-- there's a race where different processes
|
||||
-- may have a deleted and a new version of the same
|
||||
-- lock file open. checkSaneLock guards against
|
||||
-- that.
|
||||
Just lockhandle -> ifM (checkSaneLock lck lockhandle)
|
||||
( do
|
||||
createtfile
|
||||
|
|
Loading…
Reference in a new issue