diff --git a/CHANGES.txt b/CHANGES.txt index 1f67f3be69..9ba081fe71 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -119,6 +119,7 @@ 3.11.1 + * Fix cassandra-stress hang issues when an error during cluster connection happens (CASSANDRA-12938) * Better bootstrap failure message when blocked by (potential) range movement (CASSANDRA-13744) * "ignore" option is ignored in sstableloader (CASSANDRA-13721) * Deadlock in AbstractCommitLogSegmentManager (CASSANDRA-13652) diff --git a/tools/stress/src/org/apache/cassandra/stress/StressAction.java b/tools/stress/src/org/apache/cassandra/stress/StressAction.java index a90f9ff593..e634f14301 100644 --- a/tools/stress/src/org/apache/cassandra/stress/StressAction.java +++ b/tools/stress/src/org/apache/cassandra/stress/StressAction.java @@ -418,23 +418,27 @@ public class StressAction implements Runnable { SimpleClient sclient = null; JavaDriverClient jclient = null; - - final ConnectionAPI clientType = settings.mode.api; - switch (clientType) - { - case JAVA_DRIVER_NATIVE: - jclient = settings.getJavaDriverClient(); - break; - case SIMPLE_NATIVE: - sclient = settings.getSimpleNativeClient(); - break; - default: - throw new IllegalStateException(); - } - // synchronize the start of all the consumer threads - start.countDown(); + try + { + switch (clientType) + { + case JAVA_DRIVER_NATIVE: + jclient = settings.getJavaDriverClient(); + break; + case SIMPLE_NATIVE: + sclient = settings.getSimpleNativeClient(); + break; + default: + throw new IllegalStateException(); + } + } + finally + { + // synchronize the start of all the consumer threads + start.countDown(); + } releaseConsumers.await();