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

View File

@ -2120,7 +2120,9 @@ protected AppMasterLauncher setupAppMasterLauncher(String clustername,
amLauncher.setKeepContainersOverRestarts(true);
// set lifetime in submission context;
Map<ApplicationTimeoutType, Long> appTimeout = new HashMap<>();
appTimeout.put(ApplicationTimeoutType.LIFETIME, lifetime);
if (lifetime >= 0) {
appTimeout.put(ApplicationTimeoutType.LIFETIME, lifetime);
}
amLauncher.submissionContext.setApplicationTimeouts(appTimeout);
int maxAppAttempts = config.getInt(KEY_AM_RESTART_LIMIT, 0);
amLauncher.setMaxAppAttempts(maxAppAttempts);