diff options
author | Saša Živkov <sasa.zivkov@sap.com> | 2019-06-21 10:51:34 +0200 |
---|---|---|
committer | David Pursehouse <dpursehouse@collab.net> | 2019-07-03 11:48:40 +0000 |
commit | c3e8d153316035a0c24d8383be1cb2390752ab82 (patch) | |
tree | 74c0968149e001f05b928d577af528d188c20bf7 | |
parent | 0fe68ab58cccfae23d113a22d3ce66296b7e9fae (diff) |
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
(cherry picked from commit 6fcdcf98fe61e8c6258fb40967f0cff6b8c38fd4)
-rw-r--r-- | src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java | 2 |
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 1efad4f..20f5a0b 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java +++ b/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java @@ -379,10 +379,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); } } |