Page MenuHomePhabricator

Instance reporting possible lock issue around `git fetch` of clustered working copies
Open, Needs TriagePublic

Description

An instance is reporting encountering this error:

EXCEPTION: (CommandException) Command failed with error #1!
COMMAND
git fetch --prune -- '********' '+refs/*:refs/*'

STDOUT
(empty)

STDERR
error: Ref refs/heads/master is at <X> but expected <Y>

From <origin>
 ! Y..X  master     -> master  (unable to update local ref)

...where X and Y are commit hashes. This points at missing or inconsistent locking on some pathway where we run git fetch.

Details

Differential Revisions
D18268: Add a missing read lock

Event Timeline

Specifically, from the error, since X and Y are consistent in the error part and the fetch part, it appears that this process has lost a race to another process which is doing the same fetch.

I am also seeing this error and am trying to work on a fix.