ignore failure to clean up stale transfer lock file
Perhaps due to permissions problem, or perhaps a race with another process also cleaning up.
This commit is contained in:
parent
9de5cd2966
commit
87f28bb2ea
1 changed files with 9 additions and 7 deletions
|
@ -145,13 +145,15 @@ checkTransfer t = do
|
||||||
StatusNoLockFile -> return Nothing
|
StatusNoLockFile -> return Nothing
|
||||||
StatusUnLocked -> do
|
StatusUnLocked -> do
|
||||||
-- Take a non-blocking lock while deleting
|
-- Take a non-blocking lock while deleting
|
||||||
-- the stale lock file.
|
-- the stale lock file. Ignore failure
|
||||||
r <- tryLockExclusive Nothing lck
|
-- due to permissions problems, races, etc.
|
||||||
case r of
|
void $ tryIO $ do
|
||||||
Just lockhandle -> do
|
r <- tryLockExclusive Nothing lck
|
||||||
cleanstale
|
case r of
|
||||||
dropLock lockhandle
|
Just lockhandle -> do
|
||||||
_ -> noop
|
cleanstale
|
||||||
|
dropLock lockhandle
|
||||||
|
_ -> noop
|
||||||
return Nothing
|
return Nothing
|
||||||
#else
|
#else
|
||||||
v <- liftIO $ lockShared $ transferLockFile tfile
|
v <- liftIO $ lockShared $ transferLockFile tfile
|
||||||
|
|
Loading…
Reference in a new issue