git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Derrick Stolee <stolee@gmail.com>
To: 刘钟博 <liuzhongbo.gg@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: The maintenance tasks will never run if maintenance.lock is accidentally not deleted
Date: Wed, 25 Sep 2024 09:50:58 -0400	[thread overview]
Message-ID: <8b6394ef-9ff6-4fb0-bfdb-3bf02b2f4bdb@gmail.com> (raw)
In-Reply-To: <CAN477tFqDM64NsoXYKww7Xh7rNajMGn0DK062AjxDOmp+_7Lig@mail.gmail.com>

On 9/23/24 6:26 AM, 刘钟博 wrote:
 > Thank you for your response.
 > On Thu, Sep 19, 2024 at 8:56 PM Derrick Stolee <stolee@gmail.com> wrote:
 >> 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.
 > Yes, it is not necessarily a problem caused by git failure. I think it
 > is a natural
 > shortcoming of file existence lock, which cannot guarantee that the lock will be
 > released when the process exits abnormally.
 >
 >> 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.
 >> [1] https://github.com/microsoft/git/pull/598
 > I read your commit and explored more. Perhaps the file locks provided by the
 > systems are a better choice, such as fcntl() on POSIX and LockFileEx()
 > on Windows.
 > They can be automatically released when the process exits abnormally.
 > If there are
 > no objections, I'll give it a try and send a patch in a few days.

I'm curious to see how this would be implemented across platforms.

I think the maintenance.lock file is a particular case where such a
change would be welcome, because we are not writing to it and then doing
a rename over the non-.lock version (like we do with many other files).

For that reason, you would be creating a new API construct, not
replacing the existing lockfile API.

Thanks,
-Stolee


      reply	other threads:[~2024-09-25 13:51 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
2024-09-23 10:26   ` 刘钟博
2024-09-25 13:50     ` Derrick Stolee [this message]

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=8b6394ef-9ff6-4fb0-bfdb-3bf02b2f4bdb@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).