Skip to content

Commit 70d7f27

Browse files
committed
Make completion handler always reactive to countdown
Otherwise a consumer failure would never make the JVM stop. This could happen with consumer-only run, where connection recovery is disabled. [#159130745] References #106
1 parent 3d8bd16 commit 70d7f27

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/java/com/rabbitmq/perf/MulticastSet.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,11 @@ public void countDown() {
391391
}
392392
}
393393

394+
/**
395+
* This completion handler waits forever, but it can be counted down,
396+
* typically when a producer or a consumer fails. This avoids
397+
* PerfTest hanging after a failure.
398+
*/
394399
static class NoLimitCompletionHandler implements CompletionHandler {
395400

396401
private final CountDownLatch latch = new CountDownLatch(1);
@@ -402,6 +407,7 @@ public void waitForCompletion() throws InterruptedException {
402407

403408
@Override
404409
public void countDown() {
410+
latch.countDown();
405411
}
406412
}
407413
}

0 commit comments

Comments
 (0)