public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jeff King <peff@peff•net>
To: Junio C Hamano <gitster@pobox•com>
Cc: Paulo Casaretto via GitGitGadget <gitgitgadget@gmail•com>,
	git@vger•kernel.org, Taylor Blau <me@ttaylorr•com>,
	Paulo Casaretto <pcasaretto@gmail•com>
Subject: Re: [PATCH] lockfile: add PID file for debugging stale locks
Date: Wed, 3 Dec 2025 17:32:20 -0500	[thread overview]
Message-ID: <20251203223220.GA66584@coredump.intra.peff.net> (raw)
In-Reply-To: <xmqqsedr5hrc.fsf@gitster.g>

On Wed, Dec 03, 2025 at 02:21:11PM -0800, Junio C Hamano wrote:

> 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.

I like a single log much better from a management perspective. I agree
that atomicity is a potential issue, though. I think that even if we
kept it small, network filesystems like NFS do not provide great
guarantees for atomic appends. Something like flock() can work there,
but that's not something we've relied on before.

It also raises questions about reading (do we find pid files in the log
in order to provide more directed advice?) and maintenance (do we ever
clean it up, or just let it grow without bound?).

-Peff

  reply	other threads:[~2025-12-03 22:32 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-02 15:07 [PATCH] lockfile: add PID file for debugging stale locks Paulo Casaretto via GitGitGadget
2025-12-02 22:29 ` D. Ben Knoble
2025-12-03 19:48 ` Torsten Bögershausen
2025-12-03 21:16 ` Jeff King
2025-12-03 22:21   ` Junio C Hamano
2025-12-03 22:32     ` Jeff King [this message]
2025-12-03 23:19   ` Taylor Blau
2025-12-05 11:03     ` Patrick Steinhardt
2025-12-05 18:46     ` Jeff King
2025-12-03 23:39 ` Taylor Blau
2025-12-17 18:59 ` [PATCH v2] " Paulo Casaretto via GitGitGadget
2025-12-18  0:32   ` Junio C Hamano
2025-12-18  0:47   ` Junio C Hamano
2025-12-18  1:33     ` Junio C Hamano
2025-12-18  3:38   ` Ben Knoble
2025-12-18  8:07   ` Patrick Steinhardt
2025-12-24 12:24   ` [PATCH v3] " Paulo Casaretto via GitGitGadget
2025-12-25  0:01     ` Junio C Hamano
2025-12-27  7:50     ` Jeff King
2026-01-05 12:23       ` Patrick Steinhardt
2026-01-07 16:45     ` [PATCH v4] " Paulo Casaretto via GitGitGadget
2026-01-08  1:59       ` Junio C Hamano
2026-01-08 14:19         ` D. Ben Knoble
2026-01-20 18:32       ` [PATCH v5] " Paulo Casaretto via GitGitGadget
2026-01-20 20:02         ` Junio C Hamano
2026-01-21  7:13         ` Jeff King
2026-01-21  8:13           ` Eric Sunshine
2026-01-21 10:14             ` Johannes Sixt
2026-01-21 16:39             ` Jeff King
2026-01-21 18:55               ` Junio C Hamano
2026-01-21 19:53                 ` Jeff King
2026-01-21 16:23           ` Junio C Hamano
2026-01-22 19:23         ` [PATCH v6] " Paulo Casaretto via GitGitGadget
2026-01-22 20:17           ` Junio C Hamano
2026-02-06 16:27           ` Patrick Steinhardt
2026-02-06 19:31             ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251203223220.GA66584@coredump.intra.peff.net \
    --to=peff@peff$(echo .)net \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitgitgadget@gmail$(echo .)com \
    --cc=gitster@pobox$(echo .)com \
    --cc=me@ttaylorr$(echo .)com \
    --cc=pcasaretto@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox