Merge branch 'stable-3.11' into stable-3.12 * stable-3.11: Fix concurrent pushes to the same target URI Change-Id: I7b5778de0a757023180e5d02f934bbf57e354936
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 d535934..41a9a49 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java +++ b/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java
@@ -672,7 +672,7 @@ } RunwayStatus requestRunway(PushOne op) { - stateLock.withWriteLock( + return stateLock.withWriteLock( op.getURI(), () -> { if (op.wasCanceled()) { @@ -685,9 +685,8 @@ } op.notifyNotAttempted(op.setStartedRefs(replicationTasksStorage.get().start(op))); queue.inFlight.put(op.getURI(), op); - return null; + return RunwayStatus.allowed(); }); - return RunwayStatus.allowed(); } void notifyFinished(PushOne op) {