RepoUpdater: Convert ConcurrentRefUpdateException into LockFailureException

Calling the RepoCommand may fail with a ConcurrentRefUpdateException
that represents a LOCK_FAILURE. Convert this exception into a
LockFailureException so that our auto-retrying logic for LOCK_FAILURES
can recognize the LOCK_FAILURE and retry the operation, instead of
failing immediately.

Example stacktrace:
update for foo/manifest:*:default.xml (Repo) => foo/superproject:* (ref refs/heads/main) failed: org.eclipse.jgit.api.errors.ConcurrentRefUpdateException: Cannot lock refs/heads/main. Ensure that no other process has an open file handle on the lock file refs/heads/main.lock, then you may delete the lock file and retry.. RefUpdate return code was: LOCK_FAILURE
	at org.eclipse.jgit.gitrepo.BareSuperprojectWriter.commitTreeOnCurrentTip(
	at org.eclipse.jgit.gitrepo.BareSuperprojectWriter.write(
	at com.googlesource.gerrit.plugins.supermanifest.RepoUpdater.update(
	at com.googlesource.gerrit.plugins.supermanifest.SuperManifestRefUpdatedListener.updateForConfig(
	at com.googlesource.gerrit.plugins.supermanifest.SuperManifestRefUpdatedListener.onGitReferenceUpdated(

Follow the example of change I2ff60b01a in gerrit core.

Change-Id: I46be2ee251bfef9dee4ea65c3f689415095501dd
Signed-off-by: Edwin Kempin <>
1 file changed
tree: 2795e381c6fc3275101f802204ca3944b0877d83
  1. java/
  2. javatests/
  3. BUILD
  4. external_plugin_deps.bzl

The plugin will update a superproject to contain the submodules defined in the manifest XML file whenever the manifest repo is changed.

For more information see the documentation or the build instructions