YARN-5813. Slider should not try to set a negative lifetime timeout value. Contributed by Jian He

This commit is contained in:
Gour Saha 2016-11-01 17:39:54 -07:00 committed by Jian He
parent 3741e5518f
commit 25411a1742
1 changed files with 3 additions and 1 deletions

View File

@ -2120,7 +2120,9 @@ public class SliderClient extends AbstractSliderLaunchedService implements RunSe
amLauncher.setKeepContainersOverRestarts(true); amLauncher.setKeepContainersOverRestarts(true);
// set lifetime in submission context; // set lifetime in submission context;
Map<ApplicationTimeoutType, Long> appTimeout = new HashMap<>(); Map<ApplicationTimeoutType, Long> appTimeout = new HashMap<>();
appTimeout.put(ApplicationTimeoutType.LIFETIME, lifetime); if (lifetime >= 0) {
appTimeout.put(ApplicationTimeoutType.LIFETIME, lifetime);
}
amLauncher.submissionContext.setApplicationTimeouts(appTimeout); amLauncher.submissionContext.setApplicationTimeouts(appTimeout);
int maxAppAttempts = config.getInt(KEY_AM_RESTART_LIMIT, 0); int maxAppAttempts = config.getInt(KEY_AM_RESTART_LIMIT, 0);
amLauncher.setMaxAppAttempts(maxAppAttempts); amLauncher.setMaxAppAttempts(maxAppAttempts);