Re: [PATCH] lockfile: add PID file for debugging stale locks
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 3, 2025, 22:21 UTC
- Message-ID
- <xmqqsedr5hrc.fsf@gitster.g>
- In-Reply-To
- <20251203211610.GA64204@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> So I dunno what that means for your patch. I notice that the user has to > enable the feature manually. But it feels more like it should be > selective based on which subsystem is using the lockfile (so refs would > never want it, but other lockfiles/tempfiles might).
Or perhaps the way to opt into the feature is to create an empty file $GIT_DIR/lockfile-audit, and the lockfile subsystem will append to it every time a lock is taken? We need to ensure that a PID and pathname formatted into a single record is small enough and O_APPEND would relieve us from worrying about multi writer races, which may introduce different kind of complications, though.