You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by an...@apache.org on 2016/11/23 04:47:11 UTC
[2/6] mesos git commit: Fail container launch if it's destroyed
during logger->prepare().
Fail container launch if it's destroyed during logger->prepare().
Review: https://reviews.apache.org/r/49725
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/90b5be8e
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/90b5be8e
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/90b5be8e
Branch: refs/heads/0.28.x
Commit: 90b5be8e95c5868ea9142625b97050a75d0664f5
Parents: 56b4c56
Author: Jiang Yan Xu <xu...@apple.com>
Authored: Wed Jul 6 13:48:34 2016 -0700
Committer: Anand Mazumdar <an...@apache.org>
Committed: Tue Nov 22 20:30:57 2016 -0800
----------------------------------------------------------------------
src/slave/containerizer/mesos/containerizer.cpp | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/90b5be8e/src/slave/containerizer/mesos/containerizer.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/containerizer.cpp b/src/slave/containerizer/mesos/containerizer.cpp
index 52906dd..b1dc7a8 100644
--- a/src/slave/containerizer/mesos/containerizer.cpp
+++ b/src/slave/containerizer/mesos/containerizer.cpp
@@ -1221,7 +1221,13 @@ Future<bool> MesosContainerizerProcess::isolate(
const ContainerID& containerId,
pid_t _pid)
{
- CHECK(containers_.contains(containerId));
+ if (!containers_.contains(containerId)) {
+ return Failure("Container is already destroyed");
+ }
+
+ if (containers_[containerId]->state == DESTROYING) {
+ return Failure("Container is currently being destroyed");
+ }
containers_[containerId]->state = ISOLATING;