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

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

From
yoh@onerussian.com <yoh@onerussian.com>
Date
Jan 12, 2021, 17:46 UTC
Message-ID
<X/3gbjQs7+wHoJpb@lena.dartmouth.edu>
In-Reply-To
<X/ymFuUPn2POWA/p@nand.local>
On Mon, 11 Jan 2021, Taylor Blau wrote:
> ++
> +*NOTE*: this operation can race with concurrent modification to the
> +source repository, similar to running `cp -r src dst` while modifying
> +`src`.

Couldn't `gc` be triggered by git in seemingly read-only operations, thus possibly ruining the analogy with `cp` while doing `rm` (explicit intent to modify)?

Moreover, situation is also a bit different since a sane user script would not place `rm` into background to keep operating on original source right before doing `cp` -- and that is what is happening here:

`git` operation is presumably complete (but leaves `gc` running in the background) and script advances to the next step only to run into a race condition with that preceding `git` command which apparently triggered `gc`. Should then any script which operates on local `git` repositories not to forget to add -c gc.autodetach=0 for every git invocation which might be potentially effected?

Cheers,
-- 
Yaroslav O. Halchenko
Center for Open Neuroscience     http://centerforopenneuroscience.org
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
WWW:   http://www.linkedin.com/in/yarik        
Previous: Taylor BlauNext: Taylor Blau
Message 5 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.