clean up side lock files when we're done with them
authorJoey Hess <joeyh@joeyh.name>
Mon, 16 Nov 2015 15:36:11 +0000 (11:36 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 16 Nov 2015 15:36:11 +0000 (11:36 -0400)
commit2e44da5c46d8d7672e8d0074afb548b570476f28
tree8ca9a02be654d67d8fadae573933577457fa0417
parent4f10cf7434639e01e7b22d4899afbaecd9f5781f
clean up side lock files when we're done with them

There's a potential race, but it's detected and just results in the other
process failing to take the side lock, so possibly retrying one second
later on. The race window is quite narrow so the extra delay is minor.

Left the side lock files mode 666 because an interruption can leave a side
lock file created by another user for a shared repository. When this
happens, the non-owning user can't delete it (+t) but can still lock it,
and so the code falls back to acting as it did before this commit.
Utility/LockFile/PidLock.hs