You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2019/11/02 04:41:06 UTC
[hbase] branch branch-2.2 updated: HBASE-23244 NPEs running Canary
(#784)
This is an automated email from the ASF dual-hosted git repository.
stack pushed a commit to branch branch-2.2
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.2 by this push:
new 81a5dc1 HBASE-23244 NPEs running Canary (#784)
81a5dc1 is described below
commit 81a5dc11a4af7cb1c5b20dcd796cad0c6c54456a
Author: Michael Stack <sa...@users.noreply.github.com>
AuthorDate: Fri Nov 1 21:40:23 2019 -0700
HBASE-23244 NPEs running Canary (#784)
Signed-off-by: Viraj Jasani <vi...@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();