hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject git commit: HBASE-11458 NPEs if RegionServer cannot initialize
Date Tue, 08 Jul 2014 03:38:12 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 bd76eb234 -> 5dda90e72


HBASE-11458 NPEs if RegionServer cannot initialize


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

Branch: refs/heads/0.98
Commit: 5dda90e723d9fc8d60af25350ecf8289f534b5be
Parents: bd76eb2
Author: Enis Soztutar <enis@apache.org>
Authored: Mon Jul 7 20:38:00 2014 -0700
Committer: Enis Soztutar <enis@apache.org>
Committed: Mon Jul 7 20:38:00 2014 -0700

----------------------------------------------------------------------
 .../hbase/regionserver/HRegionServer.java       | 32 +++++++++++++++-----
 1 file changed, 24 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/5dda90e7/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
index 541463e..300b0b4 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
@@ -926,7 +926,9 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa
       cacheConfig.getBlockCache().shutdown();
     }
 
-    movedRegionsCleaner.stop("Region Server stopping");
+    if (movedRegionsCleaner != null) {
+      movedRegionsCleaner.stop("Region Server stopping");
+    }
 
     // Send interrupts to wake up threads if sleeping so they notice shutdown.
     // TODO: Should we check they are alive? If OOME could have exited already
@@ -944,7 +946,9 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa
     }
 
     // Stop the snapshot and other procedure handlers, forcefully killing all running tasks
-    rspmHost.stop(this.abortRequested || this.killed);
+    if (rspmHost != null) {
+      rspmHost.stop(this.abortRequested || this.killed);
+    }
 
     if (this.killed) {
       // Just skip out w/o closing regions.  Used when testing.
@@ -988,8 +992,12 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa
     if (this.rssStub != null) {
       this.rssStub = null;
     }
-    this.rpcClient.stop();
-    this.leases.close();
+    if (this.rpcClient != null) {
+      this.rpcClient.stop();
+    }
+    if (this.leases != null) {
+      this.leases.close();
+    }
     if (this.pauseMonitor != null) {
       this.pauseMonitor.stop();
     }
@@ -1006,7 +1014,9 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa
     // We may have failed to delete the znode at the previous step, but
     //  we delete the file anyway: a second attempt to delete the znode is likely to fail
again.
     ZNodeClearer.deleteMyEphemeralNodeOnDisk();
-    this.zooKeeper.close();
+    if (this.zooKeeper != null) {
+      this.zooKeeper.close();
+    }
     LOG.info("stopping server " + this.serverNameFromMasterPOV +
       "; zookeeper connection closed.");
 
@@ -1875,9 +1885,15 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa
     if (this.nonceManagerChore != null) {
       Threads.shutdown(this.nonceManagerChore.getThread());
     }
-    Threads.shutdown(this.compactionChecker.getThread());
-    Threads.shutdown(this.periodicFlusher.getThread());
-    this.cacheFlusher.join();
+    if (this.compactionChecker != null) {
+      Threads.shutdown(this.compactionChecker.getThread());
+    }
+    if (this.periodicFlusher != null) {
+      Threads.shutdown(this.periodicFlusher.getThread());
+    }
+    if (this.cacheFlusher != null) {
+      this.cacheFlusher.join();
+    }
     if (this.healthCheckChore != null) {
       Threads.shutdown(this.healthCheckChore.getThread());
     }


Mime
View raw message