summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaša Živkov <sasa.zivkov@sap.com>2019-06-21 10:51:34 +0200
committerSaša Živkov <sasa.zivkov@sap.com>2019-06-21 10:56:17 +0200
commit6fcdcf98fe61e8c6258fb40967f0cff6b8c38fd4 (patch)
treeb7e1421ebd7a8f523f107b4308e615f604fad879
parentf585eba0d21be222404b871bfe7a2b11e578eb14 (diff)
Make sure to always remove in-flight pushesv2.16.10
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
-rw-r--r--src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java2
1 files changed, 1 insertions, 1 deletions
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 @@ class PushOne implements ProjectRunnable, CanceledWhileRunning {
} 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);
}
}