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

Re: suspected race between packing and fetch (single case study)

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 9, 2021, 22:11 UTC
Message-ID
<xmqq35z9g3pw.fsf@gitster.c.googlers.com>
In-Reply-To
<X/ipCPFyW3gAWrHo@nand.local>
Taylor Blau <me@ttaylorr.com> writes:
Show 8 quoted lines
> Here, I think the issue is less complicated. Since you're cloning from a
> local repository, the 'git clone' command calls 'clone_local()', which
> in turn calls 'copy_or_link_directory()'. If the directory being copied
> changes while being iterated over, the receiving end isn't guaranteed to
> pick up the changes.
>
> Worse, if the source _removes_ a file that hasn't yet been copied, over,
> then the copy will fail, which is what you're seeing here.

And the source that removes a file during a repack would create a new file to keep the contents of the removed file available (if the object still matters after the repack), but because we do not retry our "cp -r" equivalent used in the clone_local(), we may not pick such a new file up.

So, we probalby should document "git clone --local" that the user should expect fallout similar to what may happen when they copy a directory hierarchy with "cp -r src dst" and muck with what is in "src" while the copy is ongoing.

Previous: Taylor BlauNext: Taylor Blau
Message 3 of 7 in “suspected race between packing and fetch (single case study)”
  1. Adina WagnerJan 8, 2021
  2. Taylor BlauJan 8, 2021
  3. Junio C HamanoJan 9, 2021
  4. Taylor BlauJan 11, 2021
  5. yoh@onerussian.comJan 12, 2021
  6. Taylor BlauJan 12, 2021
  7. yoh@onerussian.comJan 13, 2021

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.