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
Apr 10, 2014, 19:14 UTC
Message-ID
<CAAyEjTO3JTNDxDWpX+k_Z-O9=8-Vu5uyT_1eK-A8nFXWVcyD6w@mail.gmail.com>
In-Reply-To
<20140325145700.GA10132@sigill.intra.peff.net>
On Tue, Mar 25, 2014 at 10:57 AM, Jeff King <peff@peff.net> wrote:
Show 17 quoted lines
> On Tue, Mar 25, 2014 at 09:45:20AM -0400, Scott Sandler wrote:
>
>> Version of git on the server? git version 1.8.3-rc0
>
> There was significant work done between v1.8.3 and v1.8.4 on handling
> races in the ref code. As I said before, I don't think the symptoms you
> are describing are anything we have seen, or that could be triggered by
> the races we found (which were mostly to do with ref enumeration, not
> ref writing). But I would suggest upgrading to a newer version of git as
> a precaution.
>
> You mentioned elsewhere turning on the reflog, which I think is a good
> idea. If there is a race of this sort, you will see a "hole" in the
> reflog, where a ref goes from A->B, then again from A->B' (whereas with
> normal writes, it would be B->B').
>
> -Peff
This finally happened again. Here's what the reflog looks like:

2805f68 master@{0}: push 96eebc0 master@{1}: push 75bd4a6 master@{2}: push abc30da master@{3}: push eba874f master@{4}: push 10981e7 master@{5}: push 76b3957 master@{6}: push 2e3ea06 master@{7}: push 9d4e778 master@{8}: push dbd70ae master@{9}: push 508ab4f master@{10}: push 36a0ce4 master@{11}: push ddc258e master@{12}: push cf025de master@{13}: push dbd70ae master@{14}: push 95d33eb master@{15}: push 75b8e9a master@{16}: push

The commit that was lost does not show in the reflog at all, its short hash was e0de949aa. The commit that "won the race" against it is 9d4e778 (I'm inferring this based on timing since it was pushed at about the same time as the lost commit).

One interesting thing to note is that dbd70ae shows up at two separate points in the reflog though, one being directly before the 9d4e778 commit that won the race. According to Gitlab's event log that commit was just pushed once, right after 95d33eb and before cf025de as it shows in master@{14} there. The fact that the same commit shows up again in master@{9} is interesting.

Now that it has happened again and I've got this data, I'm going to upgrade git but let me know if this provides any insight in the mean time.

-Scott
Previous: Jeff KingNext: Matthieu Moy
Message 16 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.