YARN-8632. Threads in SLS quit without logging exception. Contributed by Xianghao Lu.
This commit is contained in:
parent
138b0c1443
commit
8563fd67be
@ -32,7 +32,6 @@
|
|||||||
import java.util.SortedMap;
|
import java.util.SortedMap;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
import java.util.concurrent.locks.Lock;
|
import java.util.concurrent.locks.Lock;
|
||||||
@ -48,6 +47,7 @@
|
|||||||
import org.apache.hadoop.classification.InterfaceStability.Unstable;
|
import org.apache.hadoop.classification.InterfaceStability.Unstable;
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.util.ReflectionUtils;
|
import org.apache.hadoop.util.ReflectionUtils;
|
||||||
|
import org.apache.hadoop.util.concurrent.HadoopScheduledThreadPoolExecutor;
|
||||||
import org.apache.hadoop.yarn.api.records.ApplicationId;
|
import org.apache.hadoop.yarn.api.records.ApplicationId;
|
||||||
import org.apache.hadoop.yarn.api.records.Resource;
|
import org.apache.hadoop.yarn.api.records.Resource;
|
||||||
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.AbstractYarnScheduler;
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.AbstractYarnScheduler;
|
||||||
@ -169,7 +169,7 @@ void init(ResourceScheduler resourceScheduler, Configuration config)
|
|||||||
web.start();
|
web.start();
|
||||||
|
|
||||||
// a thread to update histogram timer
|
// a thread to update histogram timer
|
||||||
pool = new ScheduledThreadPoolExecutor(2);
|
pool = new HadoopScheduledThreadPoolExecutor(2);
|
||||||
pool.scheduleAtFixedRate(new HistogramsRunnable(), 0, 1000,
|
pool.scheduleAtFixedRate(new HistogramsRunnable(), 0, 1000,
|
||||||
TimeUnit.MILLISECONDS);
|
TimeUnit.MILLISECONDS);
|
||||||
|
|
||||||
@ -518,7 +518,8 @@ class MetricsLogRunnable implements Runnable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if(running) {
|
SchedulerWrapper wrapper = (SchedulerWrapper) scheduler;
|
||||||
|
if(running && wrapper.getTracker().getQueueSet() != null) {
|
||||||
// all WebApp to get real tracking json
|
// all WebApp to get real tracking json
|
||||||
String trackingMetrics = web.generateRealTimeTrackingMetrics();
|
String trackingMetrics = web.generateRealTimeTrackingMetrics();
|
||||||
// output
|
// output
|
||||||
|
Loading…
Reference in New Issue
Block a user