summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Milanesio <luca.milanesio@gmail.com>2019-07-18 14:52:48 +0000
committerLuca Milanesio <luca.milanesio@gmail.com>2019-07-18 23:45:24 +0000
commit3b1b656d09eb2dd73f94f50772bbeb39d167b540 (patch)
tree51153b659f080a95ba95fd704958a6a31bca5fd7
parent0df288afccb53b7abbe4f2ee90f68c80e9dcd2c7 (diff)
Revert "Remove replication event from pending when runway is allowed"v2.15.15
This reverts commit e780ae61cbbba3f88558a3620065d1fcdc0768c8. Reason for revert: Creates potentially infinite Heap consumption and JVM crash when a PushOp is denied to use the runway. The problem is caused by the late removal of the PushOp from the list of pending operations, which causes the subsequent reschedule to find the same operation and double the number of replication states associated with it. If the loop happens multiple times, the generated consumption grows exponentially causing the JVM to enter a series of continuous stop-the-world GC that eventually lead to complete block of the JVM activity. The method `requestRunway` is thus not telling the truth because it is actually relying on the fact that the PushOne operation is removed also from the pending list, independently from its runway concession status. Change-Id: I6097bc7ad16c8bcc86a7d30af7d2ad331728712d
-rw-r--r--src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java b/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java
index 895e1ac..0a06093 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java
@@ -501,11 +501,11 @@ public class Destination {
if (op.wasCanceled()) {
return RunwayStatus.canceled();
}
+ pending.remove(op.getURI());
PushOne inFlightOp = inFlight.get(op.getURI());
if (inFlightOp != null) {
return RunwayStatus.denied(inFlightOp.getId());
}
- pending.remove(op.getURI());
inFlight.put(op.getURI(), op);
}
return RunwayStatus.allowed();