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

Re: Git push race condition?

From
Scott Sandler <scott.m.sandler@gmail.com>
Date
Mar 24, 2014, 20:01 UTC
Message-ID
<CAAyEjTNPqPHswbrrV9pRyXUUqD8dYzJaXQpWr+g3kuBERNLMRw@mail.gmail.com>
In-Reply-To
<vpq61n3bcve.fsf@anie.imag.fr>

It's a bare repo and I didn't realize server-side reflogs were a thing. Just ran "git config core.logallrefupdates true" in the repo on the server which seems to be what I should do to enable that.

The server does know about B, it shows up when you do "git show B". However "git branch --contains B" returns nothing.

The filesystem is ext4 on linux. It's on a virtual machine in our own datacenter. It's not an NFS share or anything like that, there is definitely only one server accessing the filesystem at a time.

Gitlab's update hook maintains an event log when any push event happens, who pushed and which commits. The most recent time this happened, the first push which was lost occured at 2014-03-24 19:04:51 and the one that overwrote it happened at 2014-03-24 19:05:04. That's when the update hook ran, not necessarily when the user hit "git push", but it is notable that it's 13 seconds apart which is a pretty long time. We do run several hooks for checking coding syntax and various other things so it's believable to me that the hooks would take more than 13 seconds on occasion, but based on the testing I did with the sleep hook it didn't seem like the hooks were actually the problem.

On Mon, Mar 24, 2014 at 3:44 PM, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:

Show 17 quoted lines
> Scott Sandler <scott.m.sandler@gmail.com> writes:
>
>> Both pushes are
>> determined to be fast-forwards and both succeed, but B' overwrites B
>> and B is no longer on origin/master. The server does have B in its
>> .git directory but the commit isn't on any branch.
>
> Is the reflog enabled on the server? If so, does it say anything about B
> and B'?
>
> What filesystem do you use on the server? Is there any kind of NFS, and
> if so are you sure that there's only one machine accessing the
> filesystem at the same time?
>
> --
> Matthieu Moy
> http://www-verimag.imag.fr/~moy/
Previous: Matthieu MoyNext: Matthieu Moy
Message 3 of 17 in “Git push race condition?”
  1. Scott SandlerMar 24, 2014
  2. Matthieu MoyMar 24, 2014
  3. Scott SandlerMar 24, 2014
  4. Matthieu MoyMar 24, 2014
  5. Junio C HamanoMar 24, 2014
  6. Ævar Arnfjörð BjarmasonMar 24, 2014
  7. Scott SandlerMar 24, 2014
  8. Jeff KingMar 24, 2014
  9. Jeff KingMar 24, 2014
  10. Nasser GrainawiMar 24, 2014
  11. Scott SandlerMar 25, 2014
  12. Matthieu MoyMar 25, 2014
  13. Scott SandlerMar 25, 2014
  14. Matthieu MoyMar 25, 2014
  15. Jeff KingMar 25, 2014
  16. Scott SandlerApr 10, 2014
  17. Matthieu MoyApr 11, 2014

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.