You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by st...@apache.org on 2014/08/06 12:50:56 UTC
[16/18] git commit: SLIDER-270: one-liner fix to actually resolve the
problem
SLIDER-270: one-liner fix to actually resolve the problem
Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/8d6c3fad
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/8d6c3fad
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/8d6c3fad
Branch: refs/heads/feature/SLIDER-284-hadoop2.5
Commit: 8d6c3fad0e1edc9c482f43305f82c976e3d53aa9
Parents: df963f2
Author: Steve Loughran <st...@apache.org>
Authored: Wed Aug 6 09:32:36 2014 +0100
Committer: Steve Loughran <st...@apache.org>
Committed: Wed Aug 6 09:33:07 2014 +0100
----------------------------------------------------------------------
.../apache/slider/server/appmaster/state/AppState.java | 13 ++++++++++---
.../server/appmaster/model/mock/MockYarnEngine.groovy | 2 +-
2 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/8d6c3fad/slider-core/src/main/java/org/apache/slider/server/appmaster/state/AppState.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/AppState.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/AppState.java
index 2b17c3a..db74ea8 100644
--- a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/AppState.java
+++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/AppState.java
@@ -786,7 +786,10 @@ public class AppState {
public RoleInstance getActiveContainer(ContainerId id) {
return activeContainers.get(id);
}
-
+
+ private RoleInstance removeActiveContainer(ContainerId id) {
+ return activeContainers.remove(id);
+ }
public synchronized List<RoleInstance> cloneLiveContainerInfoList() {
List<RoleInstance> allRoleInstances;
@@ -1265,11 +1268,15 @@ public class AppState {
completionOfNodeNotInLiveListEvent.incrementAndGet();
}
+
+ // and the active node list if present
+ removeActiveContainer(containerId);
+
// finally, verify the node doesn't exist any more
assert !containersBeingReleased.containsKey(
- containerId) : "container in release queue";
+ containerId) : "container still in release queue";
assert !getLiveNodes().containsKey(
- containerId) : " container in live nodes";
+ containerId) : " container still in live nodes";
assert getActiveContainer(containerId) ==
null : "Container still in active container list";
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/8d6c3fad/slider-core/src/test/groovy/org/apache/slider/server/appmaster/model/mock/MockYarnEngine.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/server/appmaster/model/mock/MockYarnEngine.groovy b/slider-core/src/test/groovy/org/apache/slider/server/appmaster/model/mock/MockYarnEngine.groovy
index 763f653..b57a79a 100644
--- a/slider-core/src/test/groovy/org/apache/slider/server/appmaster/model/mock/MockYarnEngine.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/server/appmaster/model/mock/MockYarnEngine.groovy
@@ -104,7 +104,7 @@ class MockYarnEngine {
if (op instanceof ContainerReleaseOperation) {
ContainerReleaseOperation cro = (ContainerReleaseOperation) op
ContainerId cid = cro.containerId
- releaseContainer(cid);
+ assert releaseContainer(cid);
released.add(cid)
} else {
ContainerRequestOperation req = (ContainerRequestOperation) op