From 48c931331cc43970e31866732f9ac82ee806ee03 Mon Sep 17 00:00:00 2001 From: Junping Du Date: Wed, 25 May 2016 06:18:11 -0700 Subject: [PATCH] YARN-5131. Distributed shell AM fails when extra container arrives during finishing. Contributed by Wangda Tan. --- .../yarn/applications/distributedshell/ApplicationMaster.java | 4 ++-- 1 file changed, 2 insertions(+), 2 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/ApplicationMaster.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/ApplicationMaster.java index 297397421df..e72adf534ee 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/ApplicationMaster.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/ApplicationMaster.java @@ -745,8 +745,8 @@ public class ApplicationMaster { FinalApplicationStatus appStatus; String appMessage = null; boolean success = true; - if (numFailedContainers.get() == 0 && - numCompletedContainers.get() == numTotalContainers) { + if (numCompletedContainers.get() - numFailedContainers.get() + >= numTotalContainers) { appStatus = FinalApplicationStatus.SUCCEEDED; } else { appStatus = FinalApplicationStatus.FAILED;