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

Re: concurrent fetches to update same mirror

From
Marc Branchaud <marcnarc@xiplink.com>
Date
Jan 7, 2011, 14:50 UTC
Message-ID
<4D272834.9060001@xiplink.com>
In-Reply-To
<20110106234512.GA17231@sigill.intra.peff.net>
On 11-01-06 06:45 PM, Jeff King wrote:
Show 27 quoted lines
> On Wed, Jan 05, 2011 at 03:29:47PM -0800, Junio C Hamano wrote:
> 
>> Jeff King <peff@peff.net> writes:
>>
>>> Interestingly, in the case of ref _creation_, not update, like this:
>>>
>>>   mkdir repo && cd repo && git init
>>>   git remote add origin some-remote-repo-that-takes-a-few-seconds
>>>   xterm -e 'git fetch -v; read' & xterm -e 'git fetch -v; read'
>>>
>>> then both will happily update, the second one overwriting the results of
>>> the first. It seems in the case of locking a ref which previously didn't
>>> exist, we don't enforce that it still doesn't exist.
>>
>> We probably should, especially when there is no --force or +prefix is
>> involved.
> 
> Hmph. So I created the test below to try to exercise this, expecting to
> see at least one failure: according to the above example, we aren't
> actually checking "null sha1 means ref must not exist", so we should get
> an erroneous success for that case. And there is the added complication
> that the null sha1 may also mean "don't care what the old one was". So
> even if I changed the code, we would get erroneous failures the other
> way.
> 
> But much to my surprise, it actually passes with stock git. Which means
> I need to dig a little further to see exactly what is going on.

I should point out that the repository where I saw this issue is running git 1.7.1.

		M.
Previous: Jeff KingNext: Marc Branchaud
Message 11 of 12 in “concurrent fetches to update same mirror”
  1. Neal KreitzingerJan 5, 2011
  2. Jeff KingJan 5, 2011
  3. Shawn PearceJan 5, 2011
  4. Jeff KingJan 5, 2011
  5. Jeff KingJan 5, 2011
  6. Neal KreitzingerJan 5, 2011
  7. Neal KreitzingerJan 5, 2011
  8. Jeff KingJan 5, 2011
  9. Junio C HamanoJan 5, 2011
  10. Jeff KingJan 6, 2011
  11. Marc BranchaudJan 7, 2011
  12. Marc BranchaudJan 7, 2011

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.