Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 54C0211A18 for ; Tue, 8 Jul 2014 03:38:13 +0000 (UTC) Received: (qmail 32358 invoked by uid 500); 8 Jul 2014 03:38:13 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 32309 invoked by uid 500); 8 Jul 2014 03:38:13 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 32300 invoked by uid 99); 8 Jul 2014 03:38:13 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jul 2014 03:38:13 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A26D6945B27; Tue, 8 Jul 2014 03:38:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: enis@apache.org To: commits@hbase.apache.org Message-Id: <1934c39af07e4cbd9fa018082a8332fb@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: HBASE-11458 NPEs if RegionServer cannot initialize Date: Tue, 8 Jul 2014 03:38:12 +0000 (UTC) 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 Authored: Mon Jul 7 20:38:00 2014 -0700 Committer: Enis Soztutar 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()); }