HBASE-11458 NPEs if RegionServer cannot initialize
This commit is contained in:
parent
36d84a1515
commit
b47a3f6924
|
@ -825,7 +825,9 @@ public class HRegionServer extends HasThread implements
|
|||
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
|
||||
|
@ -845,7 +847,9 @@ public class HRegionServer extends HasThread implements
|
|||
}
|
||||
|
||||
// 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.
|
||||
|
@ -897,8 +901,12 @@ public class HRegionServer extends HasThread implements
|
|||
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();
|
||||
}
|
||||
|
@ -907,7 +915,9 @@ public class HRegionServer extends HasThread implements
|
|||
stopServiceThreads();
|
||||
}
|
||||
|
||||
this.rpcServices.stop();
|
||||
if (this.rpcServices != null) {
|
||||
this.rpcServices.stop();
|
||||
}
|
||||
|
||||
try {
|
||||
deleteMyEphemeralNode();
|
||||
|
@ -918,7 +928,9 @@ public class HRegionServer extends HasThread implements
|
|||
// 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.serverName +
|
||||
"; zookeeper connection closed.");
|
||||
|
||||
|
@ -1852,9 +1864,15 @@ public class HRegionServer extends HasThread implements
|
|||
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());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue