From: Patrick Steinhardt <ps@pks•im>
To: Jeff King <peff@peff•net>
Cc: "Paulo Casaretto via GitGitGadget" <gitgitgadget@gmail•com>,
git@vger•kernel.org, "Taylor Blau" <me@ttaylorr•com>,
"D. Ben Knoble" <ben.knoble@gmail•com>,
"Torsten Bögershausen" <tboegi@web•de>,
"Paulo Casaretto (Shopify)" <paulo.casaretto@shopify•com>,
"Paulo Casaretto" <pcasaretto@gmail•com>
Subject: Re: [PATCH v3] lockfile: add PID file for debugging stale locks
Date: Mon, 5 Jan 2026 13:23:19 +0100 [thread overview]
Message-ID: <aVutN543nceW0f8W@pks.im> (raw)
In-Reply-To: <20251227075025.GC2071715@coredump.intra.peff.net>
On Sat, Dec 27, 2025 at 02:50:25AM -0500, Jeff King wrote:
> On Wed, Dec 24, 2025 at 12:24:13PM +0000, Paulo Casaretto via GitGitGadget wrote:
>
> > For a lock file "foo.lock", the PID file is named "foo~pid.lock". The
> > tilde character is forbidden in refnames and allowed in Windows
> > filenames, which guarantees no collision with the refs namespace
> > (e.g., refs "foo" and "foo~pid" cannot both exist). The file uses a
> > simple key-value format ("pid <value>") following the same pattern as
> > Git object headers, making it extensible for future metadata.
>
> FWIW, I like this approach, as the earlier collision possibilities in
> earlier iterations made me a bit uncomfortable.
>
> But then I wondered...
>
> > The feature is controlled via core.lockfilePid configuration, which
> > accepts per-component values similar to core.fsync:
> >
> > - none: Disable for all components (default)
> > - all: Enable for all components
> > - index, config, refs, commit-graph, midx, shallow, gc, other:
> > Enable for specific components
>
> Do we really need this complexity now? I can see reasons why a user
> might want to switch the feature on (because they want the extra pid
> debugging info) or off (because they do not want the extra filesystem
> operations or potential cleanup hassle of extra stale files).
>
> But if the collision problems in the ref namespace are now solved, does
> anybody really care about turning it on just for particular subsystems?
> I'd think they would want all or nothing.
>
>
> Trying to devil's advocate myself: maybe somebody is concerned about
> filesystem overhead for frequently-written files like refs but not for
> others, like config? That feels unlikely to me, but at least possible.
>
> But if we were to ditch the subsystem-granularity for config, then all
> of the extra LOCKFILE_* arguments here could just go away.
I tend to agree. Based on my own experience, references are by far the
most likely subsystem where one may hit stale lockfiles, so the feature
is most useful there. But at the same time, it's also the most expensive
subsystem to enable this feature for because we write so many small
files there.
Consequently, if anybody cares, they would most likely want to enable
this feature for refs. And, if so, the impact on other subsystems would
very likely be dwarfed by the refs overhead.
So my approach would be to enable this setting with only "true" and
"false" as possible values initially. And if we ever get a use case
where somebody would be helped by configuring this per subsystem we can
extend the config to learn about subsystems.
But ultimately I don't care too strongly about this. If the author wants
to keep the current approach I'm fine with that, too.
Patrick
next prev parent reply other threads:[~2026-01-05 12:23 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
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 [this message]
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=aVutN543nceW0f8W@pks.im \
--to=ps@pks$(echo .)im \
--cc=ben.knoble@gmail$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=gitgitgadget@gmail$(echo .)com \
--cc=me@ttaylorr$(echo .)com \
--cc=paulo.casaretto@shopify$(echo .)com \
--cc=pcasaretto@gmail$(echo .)com \
--cc=peff@peff$(echo .)net \
--cc=tboegi@web$(echo .)de \
/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