Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 321712 - ConcurrentRefUpdateException on merge, leaves repository in inconsistent state
Summary: ConcurrentRefUpdateException on merge, leaves repository in inconsistent state
Status: CLOSED WORKSFORME
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 critical (vote)
Target Milestone: 0.9.0   Edit
Assignee: Christian Halstrick CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-04 09:07 EDT by Simon Kaufmann CLA
Modified: 2011-02-02 01:25 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Kaufmann CLA 2010-08-04 09:07:40 EDT
Build Identifier: Helios (20100617-1415), JGit 0.9.0.201007291517

While merging from origin/master into my master branch, I happened to get the following Exception:

org.eclipse.jgit.api.ConcurrentRefUpdateException: Could not lock HEAD. RefUpdate return code was: LOCK_FAILURE
at org.eclipse.jgit.api.MergeCommand.updateHead(MergeCommand.java:201)
at org.eclipse.jgit.api.MergeCommand.call(MergeCommand.java:144)
at org.eclipse.egit.core.op.MergeOperation$1.run(MergeOperation.java:103)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1957)
at org.eclipse.egit.core.op.MergeOperation.execute(MergeOperation.java:124)
at org.eclipse.egit.ui.internal.repository.tree.command.MergeCommand$1.run(MergeCommand.java:90)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

As a result my master branch is not visible anymore (neither in msysgit nor in egit) and gitk complains about "unknown revision HEAD", so apparently this reference is lost as well.
Whatever caused this concurrent access, I wasn't using anything else than egit (i.e. not command line tools in parallel etc.).

Reproducible: Couldn't Reproduce

Steps to Reproduce:
In EGit:
1. checkout master
2. fetch origin
3. merge from origin/master into master
Comment 1 Simon Kaufmann CLA 2010-08-04 12:13:28 EDT
just another detail that might be helpful: the .git/refs/heads/master file got lost. 
The .git/HEAD file still exists and is pointing to refs/heads/master
Comment 2 Christian Halstrick CLA 2010-12-01 09:15:03 EST
Simon: is this one still valid? We talked about one bug but I don't think that is this one.
Comment 3 Simon Kaufmann CLA 2010-12-01 09:22:42 EST
Indeed, it's not the one we talked about. This one isn't reproducible, so I cannot really tell if it's still valid. It didn't happen again, so it doesn't really bother me.