From: Derrick Stolee <stolee@gmail.com>
To: 刘钟博 <liuzhongbo.gg@gmail.com>, git@vger.kernel.org
Subject: Re: The maintenance tasks will never run if maintenance.lock is accidentally not deleted
Date: Thu, 19 Sep 2024 08:56:33 -0400 [thread overview]
Message-ID: <cce1d054-911e-407e-bc26-1c0bac4dd8e4@gmail.com> (raw)
In-Reply-To: <CAN477tHJnVnOKfUsG5G9QAVdzYvmUuC8A8Vxt8mtHB23fd=hAQ@mail.gmail.com>
On 9/19/24 8:40 AM, 刘钟博 wrote:
> In my work, I found that the prefetch task of maintenance often
> failed, causing the fetch command to take a long time to execute in
> monorepo.
>
> After investigation, it was found that the maintenance.lock file was
> not deleted correctly for various reasons, resulting in the inability
> to trigger subsequent maintenance tasks.
This is unfortunately a common occurrence. It seems to be related to
the Git background processes being killed in such a way that does not
allow the standard lock cleanup mechanism to kick in.
At least, I haven't been able to find a reason why Git would be
failing with something like a segfault which would also cause leftover
.lock files.
> So is it recommended to add some mechanism to ensure that
> maintenance.lock can be correctly restored when it is not deleted? For
> example, add pid information to maintenance.lock, or add a lock
> timeout mechanism.
I can speak from experience of previously having a lock timeout
that this could cause problems where maintenance processes start
running on the same repo concurrently. The reason for this in the
past was due to being blocked on credential manager prompts.
I was vaguely remembering fixing that issue with credential prompts,
but then realized the change was only made to microsoft/git [1]. That
same change reverted the removal of "stale" .lock files.
I should put this together for an upstream patch series, finally.
[1] https://github.com/microsoft/git/pull/598
> I'm not sure if I missed any information, but if this is feasible, I
> would be happy to contribute such a patch.
I will CC you on my submission for the credential changes, as a way
to help introduce you to the code in this area.
Thanks,
-Stolee
next prev parent reply other threads:[~2024-09-19 12:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-19 12:40 The maintenance tasks will never run if maintenance.lock is accidentally not deleted 刘钟博
2024-09-19 12:56 ` Derrick Stolee [this message]
2024-09-23 10:26 ` 刘钟博
2024-09-25 13:50 ` Derrick Stolee
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=cce1d054-911e-407e-bc26-1c0bac4dd8e4@gmail.com \
--to=stolee@gmail.com \
--cc=git@vger.kernel.org \
--cc=liuzhongbo.gg@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).