diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairScheduler.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairScheduler.java index 18806bcbfe..c5bf02a13f 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairScheduler.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairScheduler.java @@ -51,6 +51,7 @@ import org.apache.hadoop.yarn.security.YarnAuthorizationProvider; import org.apache.hadoop.yarn.server.api.protocolrecords.NMContainerStatus; 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.reservation.ReservationConstants; import org.apache.hadoop.yarn.server.resourcemanager.resource.ResourceWeights; @@ -1268,12 +1269,16 @@ private void initScheduler(Configuration conf) throws IOException { updateThread = new UpdateThread(); updateThread.setName("FairSchedulerUpdateThread"); + updateThread.setUncaughtExceptionHandler( + new RMCriticalThreadUncaughtExceptionHandler(rmContext)); updateThread.setDaemon(true); if (continuousSchedulingEnabled) { // start continuous scheduling thread schedulingThread = new ContinuousSchedulingThread(); schedulingThread.setName("FairSchedulerContinuousScheduling"); + schedulingThread.setUncaughtExceptionHandler( + new RMCriticalThreadUncaughtExceptionHandler(rmContext)); schedulingThread.setDaemon(true); } @@ -1299,6 +1304,8 @@ private void initScheduler(Configuration conf) throws IOException { @VisibleForTesting protected void createPreemptionThread() { preemptionThread = new FSPreemptionThread(this); + preemptionThread.setUncaughtExceptionHandler( + new RMCriticalThreadUncaughtExceptionHandler(rmContext)); } private void updateReservationThreshold() {