Make sure to always remove in-flight pushes When a push is finished successfully or fails due to an error we have to remove it from the map of in-flight pushes. Although this was done from a finally block, the same block performed a Repository.close() operation prior to the in-flight push removal. If the Repository.close() threw an exception the pool.notifyFinished() wouldn't be called and we would end up with a zombie in-flight push. Bug: Issue 10852 Change-Id: I8d5918d5271ba74ce12153f054503adaef155c5c
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java b/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java index 5c24c74..83bfda0 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java +++ b/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java
@@ -388,10 +388,10 @@ } catch (PermissionBackendException | RuntimeException | Error e) { stateLog.error("Unexpected error during replication to " + uri, e, getStatesAsArray()); } finally { + pool.notifyFinished(this); if (git != null) { git.close(); } - pool.notifyFinished(this); } }