Ver código fonte

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

Gour Saha 8 anos atrás
pai
commit
25411a1742

+ 3 - 1
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 @@ public class SliderClient extends AbstractSliderLaunchedService implements RunSe
     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);