From 8f67476c533a9d06f3f9e3d53d0618a8e525b42d Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Tue, 21 Dec 2010 05:32:22 +0000 Subject: [PATCH] HBASE-3343 Server not shutting down after losing log lease git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1051380 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 1 + .../org/apache/hadoop/hbase/catalog/CatalogTracker.java | 3 ++- .../apache/hadoop/hbase/regionserver/HRegionServer.java | 2 +- .../hbase/regionserver/handler/OpenRegionHandler.java | 7 +++++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 1edf4ad9d74..c7023cb6c37 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -799,6 +799,7 @@ Release 0.90.0 - Unreleased HBASE-3371 Race in TestReplication can make it fail HBASE-3323 OOME in master splitting logs HBASE-3374 Our jruby jar has *GPL jars in it; fix + HBASE-3343 Server not shutting down after losing log lease IMPROVEMENTS diff --git a/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java b/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java index e631d4dfa81..b58cdb50356 100644 --- a/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java +++ b/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java @@ -427,7 +427,8 @@ public class CatalogTracker { Throwable cause = e.getCause(); if (cause != null && cause instanceof EOFException) { t = cause; - } else if (cause.getMessage().contains("Connection reset")) { + } else if (cause != null && cause.getMessage() != null + && cause.getMessage().contains("Connection reset")) { t = cause; } else { throw e; diff --git a/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index ef197b25a35..2ab05cb4b19 100644 --- a/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -643,7 +643,7 @@ public class HRegionServer implements HRegionInterface, HBaseRPCErrorHandler, // Interrupt catalog tracker here in case any regions being opened out in // handlers are stuck waiting on meta or root. if (this.catalogTracker != null) this.catalogTracker.stop(); - waitOnAllRegionsToClose(); + if (this.fsOk) waitOnAllRegionsToClose(); // Make sure the proxy is down. if (this.hbaseMaster != null) { diff --git a/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java b/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java index 3b30cbb28a8..3c2ac08a646 100644 --- a/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java +++ b/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java @@ -97,7 +97,7 @@ public class OpenRegionHandler extends EventHandler { if (tickleOpening("post_region_open")) { if (updateMeta(region)) failed = false; } - if (failed) { + if (failed || this.server.isStopped() || this.rsServices.isStopping()) { cleanupFailedOpen(region); return; } @@ -119,6 +119,9 @@ public class OpenRegionHandler extends EventHandler { * Caller must cleanup region if this fails. */ private boolean updateMeta(final HRegion r) { + if (this.server.isStopped() || this.rsServices.isStopping()) { + return false; + } // Object we do wait/notify on. Make it boolean. If set, we're done. // Else, wait. final AtomicBoolean signaller = new AtomicBoolean(false); @@ -324,4 +327,4 @@ public class OpenRegionHandler extends EventHandler { private boolean isGoodVersion() { return this.version != -1; } -} \ No newline at end of file +}