cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xe...@apache.org
Subject [3/6] git commit: fix terminination of the stress.java when errors were encountered patch by Pavel Yaskevich; reviewed by Brandon Williams for CASSANDRA-4128
Date Fri, 06 Apr 2012 20:38:46 GMT
fix terminination of the stress.java when errors were encountered
patch by Pavel Yaskevich; reviewed by Brandon Williams for CASSANDRA-4128


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/25da034f
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/25da034f
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/25da034f

Branch: refs/heads/trunk
Commit: 25da034fb3bb8edb393ae7908ee0d292efbb4ed9
Parents: 8df0cea
Author: Pavel Yaskevich <xedin@apache.org>
Authored: Fri Apr 6 22:32:12 2012 +0300
Committer: Pavel Yaskevich <xedin@apache.org>
Committed: Fri Apr 6 23:33:26 2012 +0300

----------------------------------------------------------------------
 CHANGES.txt                                        |    2 ++
 .../src/org/apache/cassandra/stress/Stress.java    |    2 +-
 .../org/apache/cassandra/stress/StressAction.java  |    6 +++++-
 3 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/25da034f/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index ceccc71..1d1b4fd 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/25da034f/tools/stress/src/org/apache/cassandra/stress/Stress.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/Stress.java b/tools/stress/src/org/apache/cassandra/stress/Stress.java
index 36f0410..c5e65f8 100644
--- a/tools/stress/src/org/apache/cassandra/stress/Stress.java
+++ b/tools/stress/src/org/apache/cassandra/stress/Stress.java
@@ -88,7 +88,7 @@ public final class Stress
         }
         else
         {
-            new StressAction(session, outStream).run();
+            new StressAction(session, outStream).start();
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/25da034f/tools/stress/src/org/apache/cassandra/stress/StressAction.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/StressAction.java b/tools/stress/src/org/apache/cassandra/stress/StressAction.java
index 8d6a0f5..d175170 100644
--- a/tools/stress/src/org/apache/cassandra/stress/StressAction.java
+++ b/tools/stress/src/org/apache/cassandra/stress/StressAction.java
@@ -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;
                 }
             }


Mime
View raw message