init: Catch more exceptions when testing locking.
This commit is contained in:
parent
dc19fa8b04
commit
d6e1f09ed2
3 changed files with 22 additions and 3 deletions
|
@ -51,6 +51,7 @@ import qualified Utility.LockFile.Posix as Posix
|
|||
#endif
|
||||
|
||||
import qualified Data.Map as M
|
||||
import Data.Either
|
||||
|
||||
checkCanInitialize :: Annex a -> Annex a
|
||||
checkCanInitialize a = inRepo (noAnnexFileContent . Git.repoWorkTree) >>= \case
|
||||
|
@ -233,9 +234,10 @@ probeLockSupport = do
|
|||
mode <- annexFileMode
|
||||
liftIO $ do
|
||||
nukeFile f
|
||||
ok <- catchBoolIO $ do
|
||||
Posix.dropLock =<< Posix.lockExclusive (Just mode) f
|
||||
return True
|
||||
let locktest =
|
||||
Posix.lockExclusive (Just mode) f
|
||||
>>= Posix.dropLock
|
||||
ok <- isRight <$> tryNonAsync locktest
|
||||
nukeFile f
|
||||
return ok
|
||||
#endif
|
||||
|
|
|
@ -18,6 +18,7 @@ git-annex (7.20190826) UNRELEASED; urgency=medium
|
|||
fix a bug that prevented annex.thin from taking effect for the files
|
||||
in working tree.
|
||||
* Avoid making a commit when upgrading from direct mode to v7.
|
||||
* init: Catch more exceptions when testing locking.
|
||||
|
||||
-- Joey Hess <id@joeyh.name> Sat, 24 Aug 2019 12:54:35 -0400
|
||||
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
[[!comment format=mdwn
|
||||
username="joey"
|
||||
subject="""comment 1"""
|
||||
date="2019-08-29T16:11:14Z"
|
||||
content="""
|
||||
No changes in the code of the lock test. Somehow the exception
|
||||
was not caught, and it's only catching IO exceptions, so it must
|
||||
be another type of exception.
|
||||
|
||||
Oddly, I can't find any indication that waitToSetLock can throw anything
|
||||
other than an IO exception.
|
||||
|
||||
I've changed it to catch all exceptions, which will presumably fix the
|
||||
problem, but not closing this bug as I don't fully understand it and so am
|
||||
not certian of the fix.
|
||||
"""]]
|
Loading…
Add table
Reference in a new issue