hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chia7...@apache.org
Subject hbase git commit: HBASE-19117 Avoid NPE occurring while active master dies
Date Sat, 04 Nov 2017 13:55:02 GMT
Repository: hbase
Updated Branches:
  refs/heads/master ac6b998af -> 22b07e91d


HBASE-19117 Avoid NPE occurring while active master dies


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

Branch: refs/heads/master
Commit: 22b07e91d73dfb846ce3fd1e6e270a794d161c1a
Parents: ac6b998
Author: Chia-Ping Tsai <chia7712@gmail.com>
Authored: Mon Oct 30 06:15:48 2017 +0800
Committer: Chia-Ping Tsai <chia7712@gmail.com>
Committed: Sat Nov 4 21:54:45 2017 +0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/master/HMaster.java    | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/22b07e91/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
index 7a778f2..c45b762 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
@@ -543,13 +543,16 @@ public class HMaster extends HRegionServer implements MasterServices
{
     try {
       super.run();
     } finally {
-      // If on way out, then we are no longer active master.
-      this.clusterSchemaService.stopAsync();
-      try {
-        this.clusterSchemaService.awaitTerminated(getConfiguration().getInt(HBASE_MASTER_WAIT_ON_SERVICE_IN_SECONDS,
-          DEFAULT_HBASE_MASTER_WAIT_ON_SERVICE_IN_SECONDS), TimeUnit.SECONDS);
-      } catch (TimeoutException te) {
-        LOG.warn("Failed shutdown of clusterSchemaService", te);
+      if (this.clusterSchemaService != null) {
+        // If on way out, then we are no longer active master.
+        this.clusterSchemaService.stopAsync();
+        try {
+          this.clusterSchemaService.awaitTerminated(
+              getConfiguration().getInt(HBASE_MASTER_WAIT_ON_SERVICE_IN_SECONDS,
+              DEFAULT_HBASE_MASTER_WAIT_ON_SERVICE_IN_SECONDS), TimeUnit.SECONDS);
+        } catch (TimeoutException te) {
+          LOG.warn("Failed shutdown of clusterSchemaService", te);
+        }
       }
       this.activeMaster = false;
     }


Mime
View raw message