Repository: cassandra Updated Branches: refs/heads/cassandra-2.2 081a37224 -> 6dfde0e32
Make nodetool exit with non-0 status if there is a failure Patch by marcuse; reviewed by Aleksey Yeschenko for CASSANDRA-9569 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/e7d02e39 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e7d02e39 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e7d02e39 Branch: refs/heads/cassandra-2.2 Commit: e7d02e39cb13f272ddc3d09b9a570c4d6948c37e Parents: 212a2c1 Author: Marcus Eriksson <marc...@apache.org> Authored: Tue Jun 9 10:18:25 2015 +0200 Committer: Marcus Eriksson <marc...@apache.org> Committed: Thu Jun 11 09:24:08 2015 +0200 ---------------------------------------------------------------------- CHANGES.txt | 1 + src/java/org/apache/cassandra/tools/NodeTool.java | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/e7d02e39/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 928eb55..5c31509 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.1.6 + * Make nodetool exit with non-0 status on failure (CASSANDRA-9569) * (cqlsh) Fix using COPY through SOURCE or -f (CASSANDRA-9083) * Fix occasional lack of `system` keyspace in schema tables (CASSANDRA-8487) * Use ProtocolError code instead of ServerError code for native protocol http://git-wip-us.apache.org/repos/asf/cassandra/blob/e7d02e39/src/java/org/apache/cassandra/tools/NodeTool.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/tools/NodeTool.java b/src/java/org/apache/cassandra/tools/NodeTool.java index 86b5f52..a2d4ead 100644 --- a/src/java/org/apache/cassandra/tools/NodeTool.java +++ b/src/java/org/apache/cassandra/tools/NodeTool.java @@ -286,7 +286,9 @@ public class NodeTool try (NodeProbe probe = connect()) { execute(probe); - } + if (probe.isFailed()) + throw new RuntimeException("nodetool failed, check server logs"); + } catch (IOException e) { throw new RuntimeException("Error while closing JMX connection", e);