From 1f44e6a5f4439afddb5fbe803e3a677d71e91fb2 Mon Sep 17 00:00:00 2001 From: Gour Saha Date: Thu, 1 Dec 2016 00:30:01 -0800 Subject: [PATCH] YARN-5944. Native services AM should remain up if RM is down. Contributed by Billie Rinaldi --- .../org/apache/slider/server/appmaster/SliderAppMaster.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java index 34b6a7d585..8c39343125 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java @@ -705,6 +705,11 @@ private int createAndRunCluster(String clustername) throws Throwable { synchronized (appState) { int heartbeatInterval = HEARTBEAT_INTERVAL; + // configure AM to wait forever for RM + getConfig().setLong(YarnConfiguration.RESOURCEMANAGER_CONNECT_MAX_WAIT_MS, + -1); + getConfig().unset(YarnConfiguration.CLIENT_FAILOVER_MAX_ATTEMPTS); + // add the RM client -this brings the callbacks in asyncRMClient = AMRMClientAsync.createAMRMClientAsync(heartbeatInterval, this); addService(asyncRMClient);