assistant: Avoid startup hang on active *.lock file
authorJoey Hess <joeyh@joeyh.name>
Thu, 22 May 2025 16:56:31 +0000 (12:56 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 22 May 2025 16:56:58 +0000 (12:56 -0400)
commitd7a28f21c9328474178d8e8964e81023f9c428c9
treeb17f556fa11038dabde7d82247164f3968918379
parent47cf23785ed9675bdac46b008ae8451eb43df791
assistant: Avoid startup hang on active *.lock file

Avoid hanging at startup when a process has a *.lock file open in the .git
directory.

The goal is to repair stale locks, not wait for all active locks to be
closed. This was causing problems for a non-git process that has its own
lock file in a subdir of .git/.

If .git/index_lock is a non-stale lock, this does let the assistant start
up regardless. Commits by the assistant will then fail, until the process
locking the index finishes. This is not a problem, because the same
behavior could already happen if the assistant is started and then another
process locks the index.

Sponsored-by: the NIH-funded NICEMAN (ReproNim TR&D3) project
Assistant/Repair.hs
CHANGELOG
doc/bugs/assistant_does_not_commit_anything__44___waiting__63__.mdwn
doc/bugs/assistant_does_not_commit_anything__44___waiting__63__/comment_4_73717884bf2129c55a894e7f1fff490c._comment [new file with mode: 0644]