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:
Joey Hess 2015-05-19 23:46:42 -04:00
parent 9de5cd2966
commit 87f28bb2ea

View file

@ -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