Revert "HBASE-19527 Make ExecutorService threads daemon=true"

Applied prematurely. Revert.

This reverts commit 5e4ed33fa2.
This commit is contained in:
Michael Stack 2018-01-17 15:08:42 -08:00
parent 0f5b0fb759
commit af2d890055
3 changed files with 11 additions and 3 deletions

View File

@ -1710,7 +1710,6 @@ public class ProcedureExecutor<TEnvironment> {
public WorkerThread(final ThreadGroup group) { public WorkerThread(final ThreadGroup group) {
super(group, "ProcExecWrkr-" + workerId.incrementAndGet()); super(group, "ProcExecWrkr-" + workerId.incrementAndGet());
setDaemon(true);
} }
@Override @Override
@ -1785,7 +1784,6 @@ public class ProcedureExecutor<TEnvironment> {
public TimeoutExecutorThread(final ThreadGroup group) { public TimeoutExecutorThread(final ThreadGroup group) {
super(group, "ProcExecTimeout"); super(group, "ProcExecTimeout");
setDaemon(true);
} }
@Override @Override

View File

@ -178,7 +178,7 @@ public class ExecutorService {
// name the threads for this threadpool // name the threads for this threadpool
ThreadFactoryBuilder tfb = new ThreadFactoryBuilder(); ThreadFactoryBuilder tfb = new ThreadFactoryBuilder();
tfb.setNameFormat(this.name + "-%d"); tfb.setNameFormat(this.name + "-%d");
tfb.setDaemon(true); // TODO: Should these executors be daemon threads?
this.threadPoolExecutor.setThreadFactory(tfb.build()); this.threadPoolExecutor.setThreadFactory(tfb.build());
} }

View File

@ -23,6 +23,7 @@ import org.apache.hadoop.hbase.client.Table;
import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.master.HMaster;
import org.apache.hadoop.hbase.master.LoadBalancer; import org.apache.hadoop.hbase.master.LoadBalancer;
import org.apache.hadoop.hbase.regionserver.HRegion; import org.apache.hadoop.hbase.regionserver.HRegion;
import org.apache.hadoop.hbase.regionserver.Region;
import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.MediumTests;
import org.apache.hadoop.hbase.util.JVMClusterUtil; import org.apache.hadoop.hbase.util.JVMClusterUtil;
import org.apache.hadoop.hbase.util.Threads; import org.apache.hadoop.hbase.util.Threads;
@ -195,6 +196,15 @@ public class TestRegionsOnMasterOptions {
// still only carry system regions post crash. // still only carry system regions post crash.
assertEquals(masterCount, mNewActualCount); assertEquals(masterCount, mNewActualCount);
} }
// Disable balancer and wait till RIT done else cluster won't go down.
TEST_UTIL.getAdmin().balancerSwitch(false, true);
while (true) {
if (!TEST_UTIL.getHBaseCluster().getMaster().getAssignmentManager().
isMetaRegionInTransition()) {
break;
}
Threads.sleep(10);
}
} finally { } finally {
LOG.info("Running shutdown of cluster"); LOG.info("Running shutdown of cluster");
TEST_UTIL.shutdownMiniCluster(); TEST_UTIL.shutdownMiniCluster();