From a06597e34aca16f553406cc7f3663f1fc456816c Mon Sep 17 00:00:00 2001 From: Zhihong Yu Date: Wed, 16 Jan 2013 05:45:13 +0000 Subject: [PATCH] HBASE-7213 Addendum tries to fix premature LogRoller exit (Chunhui) git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1433830 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/hadoop/hbase/regionserver/HRegionServer.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 1ef468063e9..0a7409944ef 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 @@ -1473,11 +1473,14 @@ public class HRegionServer implements ClientProtocol, protected List getMetaWALActionListeners() { List listeners = new ArrayList(); - // Log roller. - this.metaHLogRoller = new MetaLogRoller(this, this); + // Using a tmp log roller to ensure metaLogRoller is alive once it is not + // null + MetaLogRoller tmpLogRoller = new MetaLogRoller(this, this); String n = Thread.currentThread().getName(); - Threads.setDaemonThreadRunning(this.metaHLogRoller.getThread(), + Threads.setDaemonThreadRunning(tmpLogRoller.getThread(), n + "MetaLogRoller", uncaughtExceptionHandler); + this.metaHLogRoller = tmpLogRoller; + tmpLogRoller = null; listeners.add(this.metaHLogRoller); return listeners; }