From: Joey Hess Date: Fri, 13 Aug 2021 19:35:18 +0000 (-0400) Subject: INotify.removeWatch can crash X-Git-Tag: archive/raspbian/10.20250416-2+rpi1~1^2~87^2~106 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ff2dc5eb18868017713473594c8bfe7677dd27fc;p=git-annex.git INotify.removeWatch can crash Unsure why, possibly if the file has been replaced by another file. --- diff --git a/Annex/Verify.hs b/Annex/Verify.hs index 72ac71b868..d9045a627e 100644 --- a/Annex/Verify.hs +++ b/Annex/Verify.hs @@ -193,7 +193,7 @@ tailVerify iv f finished = (Just <$> readTMVar hv) `orElse` ((const Nothing) <$> readTMVar finished) - INotify.removeWatch wd + void $ tryNonAsync $ INotify.removeWatch wd return v inotifycreate i cont = INotify.addWatch i evs (P.takeDirectory f) $ \case @@ -231,8 +231,9 @@ tailVerify iv f finished = wd <- INotify.addWatch i [INotify.Modify] f $ \_event -> atomically $ void $ tryPutTMVar modified () r <- follow h modified - INotify.removeWatch wd + void $ tryNonAsync $ INotify.removeWatch wd return r + -- File never showed up, but we've been told it's done being -- written to. go' _ Nothing = do