You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by qi...@apache.org on 2017/09/13 07:07:58 UTC

mesos git commit: Fixed a memory leak in composing containerizer.

Repository: mesos
Updated Branches:
  refs/heads/master 5125b80ea -> 257ee1740


Fixed a memory leak in composing containerizer.

Review: https://reviews.apache.org/r/62237


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/257ee174
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/257ee174
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/257ee174

Branch: refs/heads/master
Commit: 257ee17400dcf66f69d526d768c8fdc1b1740004
Parents: 5125b80
Author: Qian Zhang <zh...@gmail.com>
Authored: Tue Sep 12 15:17:43 2017 +0800
Committer: Qian Zhang <zh...@gmail.com>
Committed: Tue Sep 12 15:25:25 2017 +0800

----------------------------------------------------------------------
 src/slave/containerizer/composing.cpp | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/257ee174/src/slave/containerizer/composing.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/composing.cpp b/src/slave/containerizer/composing.cpp
index c076c74..587f009 100644
--- a/src/slave/containerizer/composing.cpp
+++ b/src/slave/containerizer/composing.cpp
@@ -340,6 +340,11 @@ Future<bool> ComposingContainerizerProcess::_launch(
     // Note that we don't update the state if a destroy is in progress.
     if (container->state == LAUNCHING) {
       container->state = LAUNCHED;
+
+      // This is needed for eventually removing the given container from
+      // the list of active containers.
+      container->containerizer->wait(containerId)
+        .onAny(defer(self(), &Self::destroy, containerId));
     }
 
     // Note that the return value is not impacted
@@ -483,6 +488,11 @@ Future<bool> ComposingContainerizerProcess::_launch(
     // Note that we don't update the state if a destroy is in progress.
     if (container->state == LAUNCHING) {
       container->state = LAUNCHED;
+
+      // This is needed for eventually removing the given container from
+      // the list of active containers.
+      container->containerizer->wait(containerId)
+        .onAny(defer(self(), &Self::destroy, containerId));
     }
 
     // Note that the return value is not impacted
@@ -651,11 +661,6 @@ Future<bool> ComposingContainerizerProcess::kill(
     return false;
   }
 
-  // This is needed for eventually removing the given container from
-  // the list of active containers.
-  containers_.at(containerId)->containerizer->wait(containerId)
-    .onAny(defer(self(), &Self::destroy, containerId));
-
   return containers_.at(containerId)->containerizer->kill(containerId, signal);
 }