YARN-5798. Set UncaughtExceptionHandler for all FairScheduler threads. (Yufei Gu via kasha)

This commit is contained in:
Karthik Kambatla 2017-02-16 00:03:09 -08:00
parent 11be3f70e0
commit 74dd142250
1 changed files with 7 additions and 0 deletions

View File

@ -51,6 +51,7 @@ import org.apache.hadoop.yarn.security.PrivilegedEntity.EntityType;
import org.apache.hadoop.yarn.security.YarnAuthorizationProvider; import org.apache.hadoop.yarn.security.YarnAuthorizationProvider;
import org.apache.hadoop.yarn.server.api.protocolrecords.NMContainerStatus; import org.apache.hadoop.yarn.server.api.protocolrecords.NMContainerStatus;
import org.apache.hadoop.yarn.server.resourcemanager.RMContext; import org.apache.hadoop.yarn.server.resourcemanager.RMContext;
import org.apache.hadoop.yarn.server.resourcemanager.RMCriticalThreadUncaughtExceptionHandler;
import org.apache.hadoop.yarn.server.resourcemanager.recovery.RMStateStore.RMState; import org.apache.hadoop.yarn.server.resourcemanager.recovery.RMStateStore.RMState;
import org.apache.hadoop.yarn.server.resourcemanager.reservation.ReservationConstants; import org.apache.hadoop.yarn.server.resourcemanager.reservation.ReservationConstants;
import org.apache.hadoop.yarn.server.resourcemanager.resource.ResourceWeights; import org.apache.hadoop.yarn.server.resourcemanager.resource.ResourceWeights;
@ -1268,12 +1269,16 @@ public class FairScheduler extends
updateThread = new UpdateThread(); updateThread = new UpdateThread();
updateThread.setName("FairSchedulerUpdateThread"); updateThread.setName("FairSchedulerUpdateThread");
updateThread.setUncaughtExceptionHandler(
new RMCriticalThreadUncaughtExceptionHandler(rmContext));
updateThread.setDaemon(true); updateThread.setDaemon(true);
if (continuousSchedulingEnabled) { if (continuousSchedulingEnabled) {
// start continuous scheduling thread // start continuous scheduling thread
schedulingThread = new ContinuousSchedulingThread(); schedulingThread = new ContinuousSchedulingThread();
schedulingThread.setName("FairSchedulerContinuousScheduling"); schedulingThread.setName("FairSchedulerContinuousScheduling");
schedulingThread.setUncaughtExceptionHandler(
new RMCriticalThreadUncaughtExceptionHandler(rmContext));
schedulingThread.setDaemon(true); schedulingThread.setDaemon(true);
} }
@ -1299,6 +1304,8 @@ public class FairScheduler extends
@VisibleForTesting @VisibleForTesting
protected void createPreemptionThread() { protected void createPreemptionThread() {
preemptionThread = new FSPreemptionThread(this); preemptionThread = new FSPreemptionThread(this);
preemptionThread.setUncaughtExceptionHandler(
new RMCriticalThreadUncaughtExceptionHandler(rmContext));
} }
private void updateReservationThreshold() { private void updateReservationThreshold() {