git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: The maintenance tasks will never run if maintenance.lock is accidentally not deleted

From
刘刘钟博 <liuzhongbo.gg@gmail.com>
Date
Sep 23, 2024, 10:26 UTC
Message-ID
<CAN477tFqDM64NsoXYKww7Xh7rNajMGn0DK062AjxDOmp+_7Lig@mail.gmail.com>
In-Reply-To
<cce1d054-911e-407e-bc26-1c0bac4dd8e4@gmail.com>

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.

Thanks Liuzhongbo

Previous: Derrick StoleeNext: Derrick Stolee
Message 3 of 4 in “The maintenance tasks will never run if maintenance.lock is accidentally not deleted”
  1. 刘钟博Sep 19, 2024
  2. Derrick StoleeSep 19, 2024
  3. 刘钟博Sep 23, 2024
  4. Derrick StoleeSep 25, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.