summaryrefslogtreecommitdiff
path: root/Utility/LockFile
Commit message (Collapse)AuthorAge
* avoid warnings about not exported System.Directory.isSymbolicLinkGravatar Joey Hess2016-04-28
|
* Fix build with directory-1.2.6.2.Gravatar Joey Hess2016-04-28
| | | | | | It started exporting a isSymbolicLink which supports windows. But, git-annex does no use symlinks on windows yet and this conflicts with the function by the same name from unix-compat, so hide it.
* comment typo fixGravatar Joey Hess2016-03-01
|
* fix build warnings under ghc 7.10Gravatar Joey Hess2015-12-19
| | | | | | Caused by AMP.. Since I've finally upgraded my dev laptop to 7.10, I may start missing imports that are not needed with it but are with older versions..
* fix warningGravatar Joey Hess2015-11-16
|
* store abspath to the lock fileGravatar Joey Hess2015-11-16
| | | | Avoids problems if the program chdirs
* clean up side lock files when we're done with themGravatar Joey Hess2015-11-16
| | | | | | | | | | | 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.
* starting to get a handle on how to detect that mad gleam in lustre's eyeGravatar Joey Hess2015-11-13
|
* one more try to get sane behavior our of lustreGravatar Joey Hess2015-11-13
|
* fixed a fd double-closeGravatar Joey Hess2015-11-13
|
* also compare lock file contents to double-check link workedGravatar Joey Hess2015-11-13
| | | | | And it closes the tmp file before this. I don't know if this will help avoid lustre's craziness, but it can't hurt..
* use /tmp for sidelock file when no /dev/shmGravatar Joey Hess2015-11-13
|
* require the side lock be held to take pidlockGravatar Joey Hess2015-11-13
| | | | | | This is less portable, since currently sidelocks rely on /dev/shm. But, I've seen crazy lustre inconsistencies that make me not trust the link() method at all, so what can you do.
* avoid over-long filenames for side lock filesGravatar Joey Hess2015-11-13
|
* add stat checkGravatar Joey Hess2015-11-13
| | | | | | | | I have a strace taken on a lustre filesystem on which link() returned 0, but didn't actually succeed, since the file already existed. One of the linux man pages recommended using link followed by checking like this. I was reading it yesterday, but cannot find it now.
* clean up temp fileGravatar Joey Hess2015-11-13
|
* better lock dropping orderGravatar Joey Hess2015-11-13
|
* pid locking configuration and abstraction layer for git-annexGravatar Joey Hess2015-11-12
| | | | (not actually used anywhere yet)
* add timeout for pid lock waitingGravatar Joey Hess2015-11-12
|
* module for PidLocks in LockPoolGravatar Joey Hess2015-11-12
|
* module for pid lock files with atomic stale lock file takeover when possibleGravatar Joey Hess2015-11-12
|
* add tryLockSharedGravatar Joey Hess2015-10-08
|
* open lock file ReadOnly when taking shared lockGravatar Joey Hess2015-10-08
| | | | It's only necessary to open a file for write when taking an exclusive lock.
* need more polymorphismGravatar Joey Hess2015-05-22
|
* fix crash in stale transfer lockfile cleanup codeGravatar Joey Hess2015-05-19
| | | | | Need to differentiate between the lockfile not being locked, and it not existing.
* convert lockContent to use new LockPoolsGravatar Joey Hess2015-05-19
| | | | | | | | | | | | Also cleaned up the code, avoiding creating a lock file if we're going to open it for create later anyway. And, if there's an exception while preparing to lock the file, but not at the point of actually taking the lock, throw an exception, instead of silently not locking and pretending to succeed. And, on Windows, always use lock file, even if the repo somehow got into indirect mode (maybe with cygwin git..)
* lock pools to work around non-concurrency/composition safety of POSIX fcntlGravatar Joey Hess2015-05-18
|
* comment typosGravatar Joey Hess2015-05-17
|
* Fix an unlikely race that could result in two transfers of the same key ↵Gravatar Joey Hess2015-05-12
| | | | | | running at once. As discussed in bug report.
* update my email address and homepage urlGravatar Joey Hess2015-01-21
|
* final scary locking refactoring (for now)Gravatar Joey Hess2014-08-20
| | | | | | | | | | Note that while before checkTransfer this called getLock with WriteLock, getLockStatus's use of ReadLock will also notice any exclusive locks. Since transfer info files are only locked exclusively, never shared, there is no behavior change. Also, fixes checkLocked to actually return Just False when the file exists, but is not locked.
* more lock file refactoringGravatar Joey Hess2014-08-20
| | | | | | | | Also fixes a test suite failures introduced in recent commits, where inAnnexSafe failed in indirect mode, since it tried to open the lock file ReadWrite. This is why the new checkLocked opens it ReadOnly. This commit was sponsored by Chad Horohoe.
* more lock file refactoringGravatar Joey Hess2014-08-20
|
* reorganize and refactor lock codeGravatar Joey Hess2014-08-20
Added a convenience Utility.LockFile that is not a windows/posix portability shim, but still manages to cut down on the boilerplate around locking. This commit was sponsored by Johan Herland.