Browse Source

YARN-9483. DistributedShell does not release container when failed to localize at launch. Contributed by Prabhu Joseph.

Giovanni Matteo Fumarola 6 years ago
parent
commit
ec36126346

+ 4 - 0
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/ApplicationMaster.java

@@ -1475,6 +1475,8 @@ public class ApplicationMaster {
         try {
           fs = FileSystem.get(conf);
         } catch (IOException e) {
+          numCompletedContainers.incrementAndGet();
+          numFailedContainers.incrementAndGet();
           throw new UncheckedIOException("Cannot get FileSystem", e);
         }
 
@@ -1492,6 +1494,8 @@ public class ApplicationMaster {
             LOG.info("Setting up file for localization: " + dst);
             localResources.put(fileName, localRes);
           } catch (IOException e) {
+            numCompletedContainers.incrementAndGet();
+            numFailedContainers.incrementAndGet();
             throw new UncheckedIOException(
                 "Error during localization setup", e);
           }