diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/client/SliderClient.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/client/SliderClient.java index d1f88c5fcf..ea10ed05d0 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/client/SliderClient.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/client/SliderClient.java @@ -2120,7 +2120,9 @@ protected AppMasterLauncher setupAppMasterLauncher(String clustername, amLauncher.setKeepContainersOverRestarts(true); // set lifetime in submission context; Map 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);