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

Re: Non-robust lock files in containers can lead to repo corruption

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 12, 2019, 15:54 UTC
Message-ID
<xmqqk1bibcqs.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<003901d55114$9428df40$bc7a9dc0$@nexbridge.com>
"Randall S. Becker" <rsbecker@nexbridge.com> writes:
>> The lock design of gc.pid stores the current hostname and PID of the locking
>> process in the file. If another process comes along and its hostname matches
>> the stored hostname, it checks to see if the listed PID exists. If the PID is
>> missing, it assumes the lock is stale and releases the lock.

The assumption that <hostname, pid> pair can be used to identify running process (until the pid wraps around and gets reused) does not sound particularly limited Git. Don't container folks solve it without touching individual applications? For example, is it a viable option to isolate UTS namespaces (CLONE_NEWUTS) in addition to PID namespaces (CLONE_NEWPID)?

Previous: Randall S. BeckerNext: Jeff King
Message 3 of 5 in “Non-robust lock files in containers can lead to repo corruption”
  1. Gregory SzorcAug 10, 2019
  2. Randall S. BeckerAug 12, 2019
  3. Junio C HamanoAug 12, 2019
  4. Jeff KingAug 12, 2019
  5. Junio C HamanoAug 13, 2019

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.