From 6cc5d49fa3297af1c9a51057b1c40d9ff8dd3bcd Mon Sep 17 00:00:00 2001 From: Sunil G Date: Tue, 10 Jul 2018 20:11:47 +0530 Subject: [PATCH] YARN-8473. Containers being launched as app tears down can leave containers in NEW state. Contributed by Jason Lowe. (cherry picked from commit 705e2c1f7cba51496b0d019ecedffbe5fb55c28b) --- .../application/ApplicationImpl.java | 36 ++++++++++--- .../application/TestApplication.java | 53 +++++++++++++++---- 2 files changed, 71 insertions(+), 18 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/application/ApplicationImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/application/ApplicationImpl.java index 39be7a790c4..6d84fb29076 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/application/ApplicationImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/application/ApplicationImpl.java @@ -211,6 +211,9 @@ public class ApplicationImpl implements Application { private static final ContainerDoneTransition CONTAINER_DONE_TRANSITION = new ContainerDoneTransition(); + private static final InitContainerTransition INIT_CONTAINER_TRANSITION = + new InitContainerTransition(); + private static StateMachineFactory stateMachineFactory = new StateMachineFactory