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

(cherry picked from commit 74dd142250)
This commit is contained in:
Karthik Kambatla 2017-02-16 00:03:09 -08:00
parent fefac1276a
commit 9fecd5063f
1 changed files with 7 additions and 0 deletions

View File

@ -65,6 +65,7 @@
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;
@ -1266,12 +1267,16 @@ private void initScheduler(Configuration conf) throws IOException {
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);
} }
@ -1297,6 +1302,8 @@ private void initScheduler(Configuration conf) throws IOException {
@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() {