You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by sy...@apache.org on 2016/02/13 21:10:19 UTC
[08/22] hbase git commit: HBASE-15229 Canary Tools should not call
System.Exit on error (Vishal Khandelwal)
HBASE-15229 Canary Tools should not call System.Exit on error (Vishal Khandelwal)
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/2963d59e
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/2963d59e
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/2963d59e
Branch: refs/heads/hbase-12439
Commit: 2963d59ed21de246390426cbdb57c160a4f65303
Parents: d533181
Author: Andrew Purtell <ap...@apache.org>
Authored: Wed Feb 10 10:19:49 2016 -0800
Committer: Andrew Purtell <ap...@apache.org>
Committed: Wed Feb 10 10:21:00 2016 -0800
----------------------------------------------------------------------
.../main/java/org/apache/hadoop/hbase/tool/Canary.java | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/2963d59e/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java
index b2cca32..9248c71 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java
@@ -607,9 +607,9 @@ public final class Canary implements Tool {
if (this.failOnError && monitor.hasError()) {
monitorThread.interrupt();
if (monitor.initialized) {
- System.exit(monitor.errorCode);
+ return monitor.errorCode;
} else {
- System.exit(INIT_ERROR_EXIT_CODE);
+ return INIT_ERROR_EXIT_CODE;
}
}
currentTimeLength = System.currentTimeMillis() - startTime;
@@ -618,17 +618,16 @@ public final class Canary implements Tool {
+ ") after timeout limit:" + this.timeout
+ " will be killed itself !!");
if (monitor.initialized) {
- System.exit(TIMEOUT_ERROR_EXIT_CODE);
+ return TIMEOUT_ERROR_EXIT_CODE;
} else {
- System.exit(INIT_ERROR_EXIT_CODE);
+ return INIT_ERROR_EXIT_CODE;
}
- break;
}
}
if (this.failOnError && monitor.finalCheckForErrors()) {
monitorThread.interrupt();
- System.exit(monitor.errorCode);
+ return monitor.errorCode;
}
} finally {
if (monitor != null) monitor.close();
@@ -641,7 +640,7 @@ public final class Canary implements Tool {
if (choreService != null) {
choreService.shutdown();
}
- return(monitor.errorCode);
+ return monitor.errorCode;
}
private void printUsageAndExit() {