Revised comments to reflect DockerContainerizer implementation.

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

Branch: refs/heads/master
Commit: c7f77126e20dc0f1d5a26b0f0d6bcd361bda9640
Parents: 2caf7b9
Author: Benjamin Hindman <[email protected]>
Authored: Mon Jul 14 23:22:21 2014 -0700
Committer: Benjamin Hindman <[email protected]>
Committed: Mon Aug 4 15:08:17 2014 -0700

----------------------------------------------------------------------
 src/slave/containerizer/docker.cpp | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/c7f77126/src/slave/containerizer/docker.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/docker.cpp 
b/src/slave/containerizer/docker.cpp
index 7d3549c..294b4c2 100644
--- a/src/slave/containerizer/docker.cpp
+++ b/src/slave/containerizer/docker.cpp
@@ -1055,15 +1055,19 @@ void DockerContainerizerProcess::destroy(
   LOG(INFO) << "Destroying container '" << containerId << "'";
 
   // Do a 'docker rm -f' which we'll then find out about in '_wait'
-  // after the mesos-executor exits because it's doing a 'docker wait'
-  // (via --override).
+  // after we've reaped either the container's root process (in the
+  // event that we had just launched a container for an executor) or
+  // the mesos-executor (in the case we launched a container for a
+  // task). As a reminder, the mesos-executor exits because it's doing
+  // a 'docker wait' on the container using the --override flag of
+  // mesos-executor.
   //
-  // NOTE: We might not actually have a mesos-executor running (which
-  // we could check by looking if 'containerId' is a key in
-  // 'statuses') but if that is the case then we're doing a destroy
-  // because we failed to launch the mesos-executor (see defer at
-  // bottom of 'launch') so no need to do anything after a successful
-  // 'docker rm -f'.
+  // NOTE: We might not actually have a container or mesos-executor
+  // running (which we could check by looking if 'containerId' is a
+  // key in 'statuses'). If that is the case then we're doing a
+  // destroy because we failed to launch (see defer at bottom of
+  // 'launch'). We try and destroy regardless for now, just to be
+  // safe.
 
   // TODO(benh): Retry 'docker rm -f' if it failed but the container
   // still exists (asynchronously).

Reply via email to