Re: Git push race condition?
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Mar 24, 2014, 21:16 UTC
- Message-ID
- <CACBZZX4ZEPA3sBp4-3QF6de0EWXzPkcOiqSxH3_CXV27Z=gxtw@mail.gmail.com>
- In-Reply-To
- <CAAyEjTN53+5B9Od9wW698wODNL3hR6Upot8-ZLwEksn3ir_zjA@mail.gmail.com>
On Mon, Mar 24, 2014 at 8:18 PM, Scott Sandler <scott.m.sandler@gmail.com> wrote:
> I run a private Git repository (using Gitlab) with about 200 users > doing about 100 pushes per day.
Ditto but about 2x those numbers.
> error: Ref refs/heads/master is at > 4584c1f34e07cea2df6abc8e0d407fe016017130 but expected > 61b79b6d35b066d054fb3deab550f1c51598cf5f > remote: error: failed to lock refs/heads/master
I also see this error once in a while. I read the code a while back and it's basically because there's two levels of locks that receive-pack tries to get, and it's possible for two pushers to get the first lock due to a race condition.
I've never seen data loss due to this though, because the inner lock is atomic.