Re: [PATCH v3 1/2] builtin/maintenance: fix locking with "--detach"
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 13, 2026, 10:06 UTC
- Message-ID
- <xmqqy0hnipy4.fsf@gitster.g>
- In-Reply-To
- <20260513-pks-maintenance-fix-lock-with-detach-v3-1-f27a1ac82891@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
> Note that this is a broader fix, as we now always reassign tempfiles > when daemonizing. This is a natural consequence of the semantics of > `daemonize()` though, as it essentially promises to continue running the > current process in the background.
Exactly. I do agree that it is the right wy to look at it. The process that daemonise creates and leaves in the background is logically the process that continues to execute the service the process the user started, and unless the original process explicitly says "we are done serving this thing" and cleans up tempfile or lockfile it needed to serve that thing, it is natural to make the surviving process to take over the responsibility.