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

Re: Concurrent pushes updating the same ref

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 6, 2011, 19:37 UTC
Message-ID
<7v1v4pbz6y.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20110106163035.GA7812@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 23 quoted lines
> On Thu, Jan 06, 2011 at 10:46:38AM -0500, Marc Branchaud wrote:
>
>> fatal: Unable to create
>> '/usr/xiplink/git/public/Main.git/refs/builds/3.3.0-3.lock': File exists.
>> If no other git process is currently running, this probably means a
>> git process crashed in this repository earlier. Make sure no other git
>> process is running and remove the file manually to continue.
>> fatal: The remote end hung up unexpectedly
>> 
>> I think the cause is pretty obvious, and in a normal interactive situation
>> the solution would be to simply try again.  But in a script trying again
>> isn't so straightforward.
>> 
>> So I'm wondering if there's any sense or desire to make git a little more
>> flexible here.  Maybe teach it to wait and try again once or twice when it
>> sees a lock file.  I presume that normally a ref lock file should disappear
>> pretty quickly, so there shouldn't be a need to wait very long.
>
> Yeah, we probably should try again. The simplest possible (and untested)
> patch is below. However, a few caveats:
>
>   1. This patch unconditionally retries for all lock files. Do all
>      callers want that?

I actually have to say that _no_ caller should want this. If somebody earlier crashed, we would want to know about it (and how). If somebody else alive is actively holding a lock, why not make it the responsibility of a calling script to decide if it wants to retry itself or perhaps decide to do something else?

Previous: Marc BranchaudNext: Marc Branchaud
Message 7 of 8 in “Concurrent pushes updating the same ref”
  1. Marc BranchaudJan 6, 2011
  2. Jeff KingJan 6, 2011
  3. Shawn PearceJan 6, 2011
  4. Ilari LiusvaaraJan 6, 2011
  5. Marc BranchaudJan 6, 2011
  6. Marc BranchaudJan 10, 2011
  7. Junio C HamanoJan 6, 2011
  8. Marc BranchaudJan 6, 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.