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 2017/08/16 00:49:47 UTC

[7/7] mesos git commit: Made `killNestedContainer()` use `kill()` on the containerizer.

Made `killNestedContainer()` use `kill()` on the containerizer.

Instead of invoking `destroy()` directly, `killNestedContainer()`
would invoke `kill()` to terminate the nested container.

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


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

Branch: refs/heads/master
Commit: 8fc0491be86a665bb80a0dd978d8799d6559be1f
Parents: 8c8e2af
Author: Anand Mazumdar <an...@apache.org>
Authored: Tue Aug 15 17:38:08 2017 -0700
Committer: Anand Mazumdar <an...@apache.org>
Committed: Tue Aug 15 17:48:39 2017 -0700

----------------------------------------------------------------------
 src/slave/http.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/8fc0491b/src/slave/http.cpp
----------------------------------------------------------------------
diff --git a/src/slave/http.cpp b/src/slave/http.cpp
index 2d33f0b..544a052 100644
--- a/src/slave/http.cpp
+++ b/src/slave/http.cpp
@@ -2497,6 +2497,12 @@ Future<Response> Http::killNestedContainer(
       const ContainerID& containerId =
         call.kill_nested_container().container_id();
 
+      // SIGKILL is used by default if a signal is not specified.
+      int signal = SIGKILL;
+      if (call.kill_nested_container().has_signal()) {
+        signal = call.kill_nested_container().signal();
+      }
+
       Executor* executor = slave->getExecutor(containerId);
       if (executor == nullptr) {
         return NotFound(
@@ -2518,9 +2524,9 @@ Future<Response> Http::killNestedContainer(
         return Forbidden();
       }
 
-      Future<bool> destroy = slave->containerizer->destroy(containerId);
+      Future<bool> kill = slave->containerizer->kill(containerId, signal);
 
-      return destroy
+      return kill
         .then([containerId](bool found) -> Response {
           if (!found) {
             return NotFound("Container '" + stringify(containerId) + "'"