hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [hbase] branch master updated: HBASE-23244 NPEs running Canary (#784)
Date Sat, 02 Nov 2019 04:41:31 GMT
This is an automated email from the ASF dual-hosted git repository.

stack pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/master by this push:
     new c58e80f  HBASE-23244 NPEs running Canary (#784)
c58e80f is described below

commit c58e80fbe6db6426e652ec363149b92f9e33fbb0
Author: Michael Stack <saintstack@users.noreply.github.com>
AuthorDate: Fri Nov 1 21:40:23 2019 -0700

    HBASE-23244 NPEs running Canary (#784)
    
    Signed-off-by: Viraj Jasani <virajjasani007@gmail.com>
---
 .../main/java/org/apache/hadoop/hbase/tool/CanaryTool.java    | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/CanaryTool.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/CanaryTool.java
index 6302df5..a967dab 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/CanaryTool.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/CanaryTool.java
@@ -492,7 +492,8 @@ public class CanaryTool implements Tool, Canary {
           sink.publishReadTiming(serverName, region, column, stopWatch.getTime());
         } catch (Exception e) {
           sink.publishReadFailure(serverName, region, column, e);
-          sink.updateReadFailures(region.getRegionNameAsString(), serverName.getHostname());
+          sink.updateReadFailures(region == null? "NULL": region.getRegionNameAsString(),
+              serverName == null? "NULL": serverName.getHostname());
         } finally {
           if (rs != null) {
             rs.close();
@@ -1579,6 +1580,10 @@ public class CanaryTool implements Tool, Canary {
       try (RegionLocator regionLocator =
                admin.getConnection().getRegionLocator(tableDesc.getTableName())) {
         for (HRegionLocation location: regionLocator.getAllRegionLocations()) {
+          if (location == null) {
+            LOG.warn("Null location");
+            continue;
+          }
           ServerName rs = location.getServerName();
           RegionInfo region = location.getRegion();
           tasks.add(new RegionTask(admin.getConnection(), region, rs, (RegionStdOutSink)sink,
@@ -1795,6 +1800,10 @@ public class CanaryTool implements Tool, Canary {
           try (RegionLocator regionLocator =
                    this.admin.getConnection().getRegionLocator(tableDesc.getTableName()))
{
             for (HRegionLocation location : regionLocator.getAllRegionLocations()) {
+              if (location == null) {
+                LOG.warn("Null location");
+                continue;
+              }
               ServerName rs = location.getServerName();
               String rsName = rs.getHostname();
               RegionInfo r = location.getRegion();


Mime
View raw message