fix stress tool that hangs forever on timeout or error

patch by Pavel Yaskevich; reviewed by Brandon Williams for CASSANDRA-4128
This commit is contained in:
Pavel Yaskevich 2012-04-24 10:52:54 -07:00
parent 8c9d0fb72a
commit cb67c98d57
3 changed files with 7 additions and 2 deletions

View File

@ -8,6 +8,7 @@
* cqlsh: guess correct version of Python for Arch Linux (CASSANDRA-4090) * cqlsh: guess correct version of Python for Arch Linux (CASSANDRA-4090)
* (CLI) properly handle quotes in create/update keyspace commands (CASSANDRA-4129) * (CLI) properly handle quotes in create/update keyspace commands (CASSANDRA-4129)
* Avoids possible deadlock during bootstrap (CASSANDRA-4159) * Avoids possible deadlock during bootstrap (CASSANDRA-4159)
* fix stress tool that hangs forever on timeout or error (CASSANDRA-4128)
1.0.9 1.0.9

View File

@ -88,7 +88,7 @@ public final class Stress
} }
else else
{ {
new StressAction(session, outStream).run(); new StressAction(session, outStream).start();
} }
} }

View File

@ -137,6 +137,9 @@ public class StressAction extends Thread
} }
} }
if (producer.isAlive())
producer.interrupt(); // if producer is still alive it means that we had errors in the consumers
// marking an end of the output to the client // marking an end of the output to the client
output.println("END"); output.println("END");
} }
@ -161,7 +164,8 @@ public class StressAction extends Thread
} }
catch (InterruptedException e) catch (InterruptedException e)
{ {
System.err.println("Producer error - " + e.getMessage()); if (e.getMessage() != null)
System.err.println("Producer error - " + e.getMessage());
return; return;
} }
} }