YARN-730. Fix NMClientAsync to remove completed containers. Contributed by Zhijie Shen.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1488840 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Arun Murthy 2013-06-03 04:11:33 +00:00
parent a2205a3b72
commit 52b189db90
3 changed files with 8 additions and 0 deletions

View File

@ -406,6 +406,9 @@ Release 2.1.0-beta - UNRELEASED
YARN-733. Fixed TestNMClient from failing occasionally. (Zhijie Shen via YARN-733. Fixed TestNMClient from failing occasionally. (Zhijie Shen via
vinodkv) vinodkv)
YARN-730. Fix NMClientAsync to remove completed containers. (Zhijie Shen
via acmurthy)
BREAKDOWN OF HADOOP-8562 SUBTASKS AND RELATED JIRAS BREAKDOWN OF HADOOP-8562 SUBTASKS AND RELATED JIRAS
YARN-158. Yarn creating package-info.java must not depend on sh. YARN-158. Yarn creating package-info.java must not depend on sh.

View File

@ -615,6 +615,9 @@ public class NMClientAsync extends AbstractService {
LOG.info("Container " + containerId + " is already stopped or failed"); LOG.info("Container " + containerId + " is already stopped or failed");
} else { } else {
container.handle(event); container.handle(event);
if (isCompletelyDone(container)) {
containers.remove(containerId);
}
} }
} }
} }

View File

@ -122,6 +122,8 @@ public class TestNMClientAsync {
} }
Assert.assertEquals("Error occurs in ContainerEventProcessor", 0, Assert.assertEquals("Error occurs in ContainerEventProcessor", 0,
((MockNMClientAsync1) asyncClient).errorMsgs.size()); ((MockNMClientAsync1) asyncClient).errorMsgs.size());
Assert.assertEquals("Completed container is not removed", 0,
asyncClient.containers.size());
asyncClient.stop(); asyncClient.stop();
Assert.assertFalse( Assert.assertFalse(
"The thread of Container Management Event Dispatcher is still alive", "The thread of Container Management Event Dispatcher is still alive",