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
This commit is contained in:
Zhihong Yu 2013-01-16 05:45:13 +00:00
parent db4a453149
commit a06597e34a
1 changed files with 6 additions and 3 deletions

View File

@ -1473,11 +1473,14 @@ public class HRegionServer implements ClientProtocol,
protected List<WALActionsListener> getMetaWALActionListeners() {
List<WALActionsListener> listeners = new ArrayList<WALActionsListener>();
// 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;
}