From 6cec90653dc2ae60a10262745997ea91dd872a8b Mon Sep 17 00:00:00 2001 From: Sunil G Date: Mon, 25 Feb 2019 15:28:45 +0530 Subject: [PATCH] YARN-9168. DistributedShell client timeout should be -1 by default. Contributed by Zhankun Tang. --- .../applications/distributedshell/Client.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java index 257f590c122..10cf25f5622 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java @@ -1131,14 +1131,17 @@ public class Client { + " YarnState=" + state.toString() + ", DSFinalStatus=" + dsStatus.toString() + ". Breaking monitoring loop"); return false; - } - - if (System.currentTimeMillis() > (clientStartTime + clientTimeout)) { - LOG.info("Reached client specified timeout for application. Killing application"); - forceKillApplication(appId); - return false; } - } + + // The value equal or less than 0 means no timeout + if (clientTimeout > 0 + && System.currentTimeMillis() > (clientStartTime + clientTimeout)) { + LOG.info("Reached client specified timeout for application. " + + "Killing application"); + forceKillApplication(appId); + return false; + } + } }