ACCUMULO-4335 Error conditions that result in a Halt should ensure non-zero exit code.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/f99ac9b3 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/f99ac9b3 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/f99ac9b3 Branch: refs/heads/1.7 Commit: f99ac9b31cb2194d7b6fa2debc7e018a4410afe7 Parents: 60ac92d Author: Sean Busbey <bus...@cloudera.com> Authored: Wed Jun 8 10:56:44 2016 -0500 Committer: Josh Elser <els...@apache.org> Committed: Thu Jun 9 18:39:00 2016 -0400 ---------------------------------------------------------------------- .../main/java/org/apache/accumulo/server/util/TServerUtils.java | 2 +- .../main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java | 2 +- .../src/main/java/org/apache/accumulo/tserver/TabletServer.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/f99ac9b3/server/base/src/main/java/org/apache/accumulo/server/util/TServerUtils.java ---------------------------------------------------------------------- diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/TServerUtils.java b/server/base/src/main/java/org/apache/accumulo/server/util/TServerUtils.java index d932b2a..a84cf15 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/util/TServerUtils.java +++ b/server/base/src/main/java/org/apache/accumulo/server/util/TServerUtils.java @@ -299,7 +299,7 @@ public class TServerUtils { try { finalServer.serve(); } catch (Error e) { - Halt.halt("Unexpected error in TThreadPoolServer " + e + ", halting."); + Halt.halt("Unexpected error in TThreadPoolServer " + e + ", halting.", 1); } } }; http://git-wip-us.apache.org/repos/asf/accumulo/blob/f99ac9b3/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java ---------------------------------------------------------------------- diff --git a/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java b/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java index b98daf7..6d50e94 100644 --- a/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java +++ b/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java @@ -678,7 +678,7 @@ public class SimpleGarbageCollector implements Iface { LockWatcher lockWatcher = new LockWatcher() { @Override public void lostLock(LockLossReason reason) { - Halt.halt("GC lock in zookeeper lost (reason = " + reason + "), exiting!"); + Halt.halt("GC lock in zookeeper lost (reason = " + reason + "), exiting!", 1); } @Override http://git-wip-us.apache.org/repos/asf/accumulo/blob/f99ac9b3/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java ---------------------------------------------------------------------- diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java index 955c365..8155ea6 100644 --- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java +++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java @@ -3212,7 +3212,7 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu @Override public void lostLock(final LockLossReason reason) { - Halt.halt(0, new Runnable() { + Halt.halt(serverStopRequested ? 0 : 1, new Runnable() { @Override public void run() { if (!serverStopRequested) @@ -3224,7 +3224,7 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu @Override public void unableToMonitorLockNode(final Throwable e) { - Halt.halt(0, new Runnable() { + Halt.halt(1, new Runnable() { @Override public void run() { log.fatal("Lost ability to monitor tablet server lock, exiting.", e);