From d6c987e273aa73a2dbce009dc1f69f1471b763a1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 19 May 2015 23:46:42 -0400 Subject: ignore failure to clean up stale transfer lock file Perhaps due to permissions problem, or perhaps a race with another process also cleaning up. --- Logs/Transfer.hs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'Logs') 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 -- cgit v1.2.3