fix terminination of the stress.java when errors were encountered

patch by Pavel Yaskevich; reviewed by Brandon Williams for CASSANDRA-4128
This commit is contained in:
Pavel Yaskevich 2012-04-06 22:32:12 +03:00
parent 8df0cea779
commit 25da034fb3
3 changed files with 8 additions and 2 deletions

View File

@ -9,6 +9,8 @@
(CASSANDRA-4088)
* relax path length requirement for sstable files when upgrading on
non-Windows platforms (CASSANDRA-4110)
* fix terminination of the stress.java when errors were encountered
(CASSANDRA-4128)
1.1-beta2

View File

@ -88,7 +88,7 @@ public final class Stress
}
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
output.println("END");
}
@ -161,7 +164,8 @@ public class StressAction extends Thread
}
catch (InterruptedException e)
{
System.err.println("Producer error - " + e.getMessage());
if (e.getMessage() != null)
System.err.println("Producer error - " + e.getMessage());
return;
}
}