You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by st...@apache.org on 2014/08/07 22:04:47 UTC

[34/38] git commit: SLIDER-286 AM restart count is now set to 0 in AppMasterLauncher/Slider client, so AMs get default cluster value. The value is logged at debug level

SLIDER-286 AM restart count is now set to 0 in AppMasterLauncher/Slider client, so AMs get default cluster value. The value is logged at debug level


Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/1350491f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/1350491f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/1350491f

Branch: refs/heads/feature/SLIDER-149_Support_a_YARN_service_registry
Commit: 1350491fd487987b458da75dc571c07c1ae76770
Parents: 56083ec
Author: Steve Loughran <st...@apache.org>
Authored: Thu Aug 7 17:36:45 2014 +0100
Committer: Steve Loughran <st...@apache.org>
Committed: Thu Aug 7 17:36:45 2014 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/slider/client/SliderClient.java  | 4 ++--
 .../java/org/apache/slider/core/launch/AppMasterLauncher.java | 7 +++++--
 2 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/1350491f/slider-core/src/main/java/org/apache/slider/client/SliderClient.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/client/SliderClient.java b/slider-core/src/main/java/org/apache/slider/client/SliderClient.java
index ff2e865..e1d083c 100644
--- a/slider-core/src/main/java/org/apache/slider/client/SliderClient.java
+++ b/slider-core/src/main/java/org/apache/slider/client/SliderClient.java
@@ -833,8 +833,8 @@ public class SliderClient extends AbstractSliderLaunchedService implements RunSe
     // set the application name;
     amLauncher.setKeepContainersOverRestarts(true);
 
-    amLauncher.setMaxAppAttempts(config.getInt(KEY_AM_RESTART_LIMIT,
-                                               DEFAULT_AM_RESTART_LIMIT));
+    int maxAppAttempts = config.getInt(KEY_AM_RESTART_LIMIT, 0);
+    amLauncher.setMaxAppAttempts(maxAppAttempts);
 
     sliderFileSystem.purgeAppInstanceTempFiles(clustername);
     Path tempPath = sliderFileSystem.createAppInstanceTempPath(

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/1350491f/slider-core/src/main/java/org/apache/slider/core/launch/AppMasterLauncher.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/core/launch/AppMasterLauncher.java b/slider-core/src/main/java/org/apache/slider/core/launch/AppMasterLauncher.java
index dc4a886..bd8a0a5 100644
--- a/slider-core/src/main/java/org/apache/slider/core/launch/AppMasterLauncher.java
+++ b/slider-core/src/main/java/org/apache/slider/core/launch/AppMasterLauncher.java
@@ -50,7 +50,7 @@ public class AppMasterLauncher extends AbstractLauncher {
   private final ApplicationSubmissionContext submissionContext;
   private final ApplicationId appId;
   private final boolean secureCluster;
-  private int maxAppAttempts = 2;
+  private int maxAppAttempts = 0;
   private boolean keepContainersOverRestarts = true;
   private String queue = YarnConfiguration.DEFAULT_QUEUE_NAME;
   private int priority = 1;
@@ -174,7 +174,10 @@ public class AppMasterLauncher extends AbstractLauncher {
       submissionContext.setKeepContainersAcrossApplicationAttempts(true);
     }
 
-    submissionContext.setMaxAppAttempts(maxAppAttempts);
+    if (maxAppAttempts > 0) {
+      log.debug("Setting max AM attempts to {}", maxAppAttempts);
+      submissionContext.setMaxAppAttempts(maxAppAttempts);
+    }
 
     if (secureCluster) {
       addSecurityTokens();