aboutsummaryrefslogtreecommitdiff
path: root/Logs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-05-19 23:46:42 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-05-19 23:46:42 -0400
commitd6c987e273aa73a2dbce009dc1f69f1471b763a1 (patch)
treeda7e0b323f2ee3102d32a6a68989d95306ab6829 /Logs
parent3237ddb564f5d2c07d03184d4f43c9c33c612a6c (diff)
ignore failure to clean up stale transfer lock file
Perhaps due to permissions problem, or perhaps a race with another process also cleaning up.
Diffstat (limited to 'Logs')
-rw-r--r--Logs/Transfer.hs16
1 files changed, 9 insertions, 7 deletions
diff --git a/Logs/Transfer.hs b/Logs/Transfer.hs
index 471b886b3..af6d19da6 100644
--- a/Logs/Transfer.hs
+++ b/Logs/Transfer.hs
@@ -145,13 +145,15 @@ checkTransfer t = do
StatusNoLockFile -> return Nothing
StatusUnLocked -> do
-- Take a non-blocking lock while deleting
- -- the stale lock file.
- r <- tryLockExclusive Nothing lck
- case r of
- Just lockhandle -> do
- cleanstale
- dropLock lockhandle
- _ -> noop
+ -- the stale lock file. Ignore failure
+ -- due to permissions problems, races, etc.
+ void $ tryIO $ do
+ r <- tryLockExclusive Nothing lck
+ case r of
+ Just lockhandle -> do
+ cleanstale
+ dropLock lockhandle
+ _ -> noop
return Nothing
#else
v <- liftIO $ lockShared $ transferLockFile tfile