Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F02899F73 for ; Thu, 26 Apr 2012 14:35:09 +0000 (UTC) Received: (qmail 24225 invoked by uid 500); 26 Apr 2012 14:35:09 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 24151 invoked by uid 500); 26 Apr 2012 14:35:09 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 24016 invoked by uid 99); 26 Apr 2012 14:35:09 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2012 14:35:09 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 4889AE7D8; Thu, 26 Apr 2012 14:35:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: slebresne@apache.org To: commits@cassandra.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [3/3] git commit: fix stress tool that hangs forever on timeout or error patch by Pavel Yaskevich; reviewed by Brandon Williams for CASSANDRA-4128 Message-Id: <20120426143509.4889AE7D8@tyr.zones.apache.org> Date: Thu, 26 Apr 2012 14:35:09 +0000 (UTC) fix stress tool that hangs forever on timeout or error 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/cb67c98d Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/cb67c98d Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/cb67c98d Branch: refs/heads/cassandra-1.1 Commit: cb67c98d574d941819a127bb60033fbbf34e511f Parents: 8c9d0fb Author: Pavel Yaskevich Authored: Tue Apr 24 10:52:54 2012 -0700 Committer: Pavel Yaskevich Committed: Tue Apr 24 10:52:54 2012 -0700 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../src/org/apache/cassandra/stress/Stress.java | 2 +- .../org/apache/cassandra/stress/StressAction.java | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb67c98d/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 814fe99..544d393 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -8,6 +8,7 @@ * cqlsh: guess correct version of Python for Arch Linux (CASSANDRA-4090) * (CLI) properly handle quotes in create/update keyspace commands (CASSANDRA-4129) * Avoids possible deadlock during bootstrap (CASSANDRA-4159) + * fix stress tool that hangs forever on timeout or error (CASSANDRA-4128) 1.0.9 http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb67c98d/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/cb67c98d/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 571d498..f0a9f49 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; } }