You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2017/09/26 17:38:20 UTC

[1/4] hbase git commit: Amend HBASE-18830 TestCanaryTool does not check Canary monitor's error code

Repository: hbase
Updated Branches:
  refs/heads/branch-1 fa7d0ccb0 -> 3abc0458e
  refs/heads/branch-1.4 52970c05d -> f391fc44d
  refs/heads/branch-2 6d0eb0eef -> ede916af5
  refs/heads/master 9e7b16b88 -> 91e1f834b


Amend HBASE-18830 TestCanaryTool does not check Canary monitor's error code

Adjust exception control flow to fix findbugs warning
NP_NULL_ON_SOME_PATH_EXCEPTION, Possible null pointer dereference of
regionSink in org.apache.hadoop.hbase.tool.Canary$RegionMonitor.run()
on exception path


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/3abc0458
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/3abc0458
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/3abc0458

Branch: refs/heads/branch-1
Commit: 3abc0458e9ccd5b529581dcff4b6a0dba594fcdc
Parents: fa7d0cc
Author: Andrew Purtell <ap...@apache.org>
Authored: Tue Sep 26 08:33:19 2017 -0700
Committer: Andrew Purtell <ap...@apache.org>
Committed: Tue Sep 26 10:38:09 2017 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hbase/tool/Canary.java | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/3abc0458/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 755dae0..a2b3d02 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
@@ -1022,19 +1022,14 @@ public final class Canary implements Tool {
       if (this.initAdmin()) {
         try {
           List<Future<Void>> taskFutures = new LinkedList<>();
-          RegionStdOutSink regionSink = null;
-          try {
-            regionSink = this.getSink();
-          } catch (RuntimeException e) {
-            LOG.error("Run RegionMonitor failed!", e);
-            this.errorCode = ERROR_EXIT_CODE;
-          }
+          RegionStdOutSink regionSink = this.getSink();
           if (this.targets != null && this.targets.length > 0) {
             String[] tables = generateMonitorTables(this.targets);
             // Check to see that each table name passed in the -readTableTimeouts argument is also passed as a monitor target.
             if (! new HashSet<>(Arrays.asList(tables)).containsAll(this.configuredReadTableTimeouts.keySet())) {
               LOG.error("-readTableTimeouts can only specify read timeouts for monitor targets passed via command line.");
               this.errorCode = USAGE_EXIT_CODE;
+              return;
             }
             this.initialized = true;
             for (String table : tables) {
@@ -1097,7 +1092,9 @@ public final class Canary implements Tool {
         } catch (Exception e) {
           LOG.error("Run regionMonitor failed", e);
           this.errorCode = ERROR_EXIT_CODE;
-        }
+        } finally {
+          this.done = true;
+	}
       }
       this.done = true;
     }


[4/4] hbase git commit: Amend HBASE-18830 TestCanaryTool does not check Canary monitor's error code

Posted by ap...@apache.org.
Amend HBASE-18830 TestCanaryTool does not check Canary monitor's error code

Adjust exception control flow to fix findbugs warning
NP_NULL_ON_SOME_PATH_EXCEPTION, Possible null pointer dereference of
regionSink in org.apache.hadoop.hbase.tool.Canary$RegionMonitor.run()
on exception path


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

Branch: refs/heads/branch-2
Commit: ede916af5a62ac5b10a2a2911dc47b580299b239
Parents: 6d0eb0e
Author: Andrew Purtell <ap...@apache.org>
Authored: Tue Sep 26 08:33:19 2017 -0700
Committer: Andrew Purtell <ap...@apache.org>
Committed: Tue Sep 26 10:38:17 2017 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hbase/tool/Canary.java | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/ede916af/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 64cf5db..b4e5007 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
@@ -1028,19 +1028,14 @@ public final class Canary implements Tool {
       if (this.initAdmin()) {
         try {
           List<Future<Void>> taskFutures = new LinkedList<>();
-          RegionStdOutSink regionSink = null;
-          try {
-            regionSink = this.getSink();
-          } catch (RuntimeException e) {
-            LOG.error("Run RegionMonitor failed!", e);
-            this.errorCode = ERROR_EXIT_CODE;
-          }
+          RegionStdOutSink regionSink = this.getSink();
           if (this.targets != null && this.targets.length > 0) {
             String[] tables = generateMonitorTables(this.targets);
             // Check to see that each table name passed in the -readTableTimeouts argument is also passed as a monitor target.
             if (! new HashSet<>(Arrays.asList(tables)).containsAll(this.configuredReadTableTimeouts.keySet())) {
               LOG.error("-readTableTimeouts can only specify read timeouts for monitor targets passed via command line.");
               this.errorCode = USAGE_EXIT_CODE;
+              return;
             }
             this.initialized = true;
             for (String table : tables) {
@@ -1103,7 +1098,9 @@ public final class Canary implements Tool {
         } catch (Exception e) {
           LOG.error("Run regionMonitor failed", e);
           this.errorCode = ERROR_EXIT_CODE;
-        }
+        } finally {
+          this.done = true;
+	}
       }
       this.done = true;
     }


[2/4] hbase git commit: Amend HBASE-18830 TestCanaryTool does not check Canary monitor's error code

Posted by ap...@apache.org.
Amend HBASE-18830 TestCanaryTool does not check Canary monitor's error code

Adjust exception control flow to fix findbugs warning
NP_NULL_ON_SOME_PATH_EXCEPTION, Possible null pointer dereference of
regionSink in org.apache.hadoop.hbase.tool.Canary$RegionMonitor.run()
on exception path


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

Branch: refs/heads/branch-1.4
Commit: f391fc44dfefea06810c2cce6b3f83e66948f577
Parents: 52970c0
Author: Andrew Purtell <ap...@apache.org>
Authored: Tue Sep 26 08:33:19 2017 -0700
Committer: Andrew Purtell <ap...@apache.org>
Committed: Tue Sep 26 10:38:14 2017 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hbase/tool/Canary.java | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/f391fc44/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 755dae0..a2b3d02 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
@@ -1022,19 +1022,14 @@ public final class Canary implements Tool {
       if (this.initAdmin()) {
         try {
           List<Future<Void>> taskFutures = new LinkedList<>();
-          RegionStdOutSink regionSink = null;
-          try {
-            regionSink = this.getSink();
-          } catch (RuntimeException e) {
-            LOG.error("Run RegionMonitor failed!", e);
-            this.errorCode = ERROR_EXIT_CODE;
-          }
+          RegionStdOutSink regionSink = this.getSink();
           if (this.targets != null && this.targets.length > 0) {
             String[] tables = generateMonitorTables(this.targets);
             // Check to see that each table name passed in the -readTableTimeouts argument is also passed as a monitor target.
             if (! new HashSet<>(Arrays.asList(tables)).containsAll(this.configuredReadTableTimeouts.keySet())) {
               LOG.error("-readTableTimeouts can only specify read timeouts for monitor targets passed via command line.");
               this.errorCode = USAGE_EXIT_CODE;
+              return;
             }
             this.initialized = true;
             for (String table : tables) {
@@ -1097,7 +1092,9 @@ public final class Canary implements Tool {
         } catch (Exception e) {
           LOG.error("Run regionMonitor failed", e);
           this.errorCode = ERROR_EXIT_CODE;
-        }
+        } finally {
+          this.done = true;
+	}
       }
       this.done = true;
     }


[3/4] hbase git commit: Amend HBASE-18830 TestCanaryTool does not check Canary monitor's error code

Posted by ap...@apache.org.
Amend HBASE-18830 TestCanaryTool does not check Canary monitor's error code

Adjust exception control flow to fix findbugs warning
NP_NULL_ON_SOME_PATH_EXCEPTION, Possible null pointer dereference of
regionSink in org.apache.hadoop.hbase.tool.Canary$RegionMonitor.run()
on exception path


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/91e1f834
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/91e1f834
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/91e1f834

Branch: refs/heads/master
Commit: 91e1f834bf93e4a33c253ad6bc86260add5bd6d9
Parents: 9e7b16b
Author: Andrew Purtell <ap...@apache.org>
Authored: Tue Sep 26 08:33:19 2017 -0700
Committer: Andrew Purtell <ap...@apache.org>
Committed: Tue Sep 26 10:38:17 2017 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hbase/tool/Canary.java | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/91e1f834/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 64cf5db..b4e5007 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
@@ -1028,19 +1028,14 @@ public final class Canary implements Tool {
       if (this.initAdmin()) {
         try {
           List<Future<Void>> taskFutures = new LinkedList<>();
-          RegionStdOutSink regionSink = null;
-          try {
-            regionSink = this.getSink();
-          } catch (RuntimeException e) {
-            LOG.error("Run RegionMonitor failed!", e);
-            this.errorCode = ERROR_EXIT_CODE;
-          }
+          RegionStdOutSink regionSink = this.getSink();
           if (this.targets != null && this.targets.length > 0) {
             String[] tables = generateMonitorTables(this.targets);
             // Check to see that each table name passed in the -readTableTimeouts argument is also passed as a monitor target.
             if (! new HashSet<>(Arrays.asList(tables)).containsAll(this.configuredReadTableTimeouts.keySet())) {
               LOG.error("-readTableTimeouts can only specify read timeouts for monitor targets passed via command line.");
               this.errorCode = USAGE_EXIT_CODE;
+              return;
             }
             this.initialized = true;
             for (String table : tables) {
@@ -1103,7 +1098,9 @@ public final class Canary implements Tool {
         } catch (Exception e) {
           LOG.error("Run regionMonitor failed", e);
           this.errorCode = ERROR_EXIT_CODE;
-        }
+        } finally {
+          this.done = true;
+	}
       }
       this.done = true;
     }