list mirror (unofficial, one of many)
 help / color / mirror / Atom feed
* Possible race condition with git-rebase + .git/index.lock
@ 2019-03-11 21:38 Sergio Durigan Junior
  2019-03-11 22:50 ` Eric Sunshine
  2019-03-12 10:28 ` Duy Nguyen
  0 siblings, 2 replies; 13+ messages in thread
From: Sergio Durigan Junior @ 2019-03-11 21:38 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 1623 bytes --]

Hi there,

I've been bit by this bug many times, and always forget to report it
here, but this time I finally remembered.

The scenario is this:

- I have a local repository which tracks the upstream of the project.

- I have 120+ local commits.

- Every week or so, I have to rebase my local commits on top of
  upstream's origin/master.

The workflow is simple:

  # git fetch origin && git rebase origin/master

This works without problems most of the time (well, usually there are
conflicts and all, but that's a burden I have to carry).  However,
sometimes I notice that git fails with:

  # git rebase origin/master
  Applying: commitX
  Applying: commitY
  Applying: commitZ
  fatal: Unable to create '/home/xyz/dir1/dir2/.git/index.lock': File exists.

The first thing I did was to check whether the index.lock file existed,
but it doesn't.

I also I thought it might have something to do with "commitZ", but after
I ran "git rebase --abort" and tried rebasing again, I noticed that it
would stop at another commit.

This seems like a race condition, but after inspecting builtin/rebase.c
it doesn't seem like the "git am" commands are run in parallel (and it
wouldn't make sense if they did, anyway).

I tried using GIT_TRACE, but haven't seen any useful information in the
logs.  I tried using the "next" branch, and found that the problem
exists there as well.  I wonder if anyone else has seen this problem.


GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-03-13 21:07 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-11 21:38 Possible race condition with git-rebase + .git/index.lock Sergio Durigan Junior
2019-03-11 22:50 ` Eric Sunshine
2019-03-11 22:53   ` Sergio Durigan Junior
2019-03-12 10:28 ` Duy Nguyen
2019-03-12 16:45   ` Sergio Durigan Junior
2019-03-12 19:23     ` Elijah Newren
2019-03-12 19:32       ` Sergio Durigan Junior
2019-03-12 19:39         ` Elijah Newren
2019-03-12 19:58           ` Sergio Durigan Junior
2019-03-13 20:40         ` Phillip Wood
2019-03-13 20:48           ` Sergio Durigan Junior
2019-03-13 20:59             ` Jeff King
2019-03-13 21:07               ` Sergio Durigan Junior list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ \
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
 note: .onion URLs require Tor:

code repositories for the project(s) associated with this inbox:

AGPL code for this site: git clone