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 2018/11/08 08:19:21 UTC

[mesos] 07/09: Updated launchers to use subprocess's `whitelist_fds` parameter.

This is an automated email from the ASF dual-hosted git repository.

qianzhang pushed a commit to branch 1.7.x
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 079febcc1a63886abd694d3edeeafc97eca39d8f
Author: Qian Zhang <zh...@gmail.com>
AuthorDate: Mon Sep 3 15:11:51 2018 +0800

    Updated launchers to use subprocess's `whitelist_fds` parameter.
    
    Review: https://reviews.apache.org/r/68646
---
 src/slave/containerizer/mesos/launcher.cpp       | 5 -----
 src/slave/containerizer/mesos/linux_launcher.cpp | 8 ++------
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/src/slave/containerizer/mesos/launcher.cpp b/src/slave/containerizer/mesos/launcher.cpp
index a18bdff..b38f88d 100644
--- a/src/slave/containerizer/mesos/launcher.cpp
+++ b/src/slave/containerizer/mesos/launcher.cpp
@@ -123,11 +123,6 @@ Try<pid_t> SubprocessLauncher::fork(
 
 #ifndef __WINDOWS__
   childHooks.push_back(Subprocess::ChildHook::SETSID());
-
-  // TODO(jpeach) libprocess should take care of this, see MESOS-9164.
-  foreach (int_fd fd, whitelistFds) {
-    childHooks.push_back(Subprocess::ChildHook::UNSET_CLOEXEC(fd));
-  }
 #endif // __WINDOWS__
 
   Try<Subprocess> child = subprocess(
diff --git a/src/slave/containerizer/mesos/linux_launcher.cpp b/src/slave/containerizer/mesos/linux_launcher.cpp
index e9ab36a..c10092b 100644
--- a/src/slave/containerizer/mesos/linux_launcher.cpp
+++ b/src/slave/containerizer/mesos/linux_launcher.cpp
@@ -528,11 +528,6 @@ Try<pid_t> LinuxLauncherProcess::fork(
 
   childHooks.push_back(Subprocess::ChildHook::SETSID());
 
-  // TODO(jpeach) libprocess should take care of this, see MESOS-9164.
-  foreach (int_fd fd, whitelistFds) {
-    childHooks.push_back(Subprocess::ChildHook::UNSET_CLOEXEC(fd));
-  }
-
   Try<Subprocess> child = subprocess(
       path,
       argv,
@@ -559,7 +554,8 @@ Try<pid_t> LinuxLauncherProcess::fork(
         }
       },
       parentHooks,
-      childHooks);
+      childHooks,
+      whitelistFds);
 
   if (child.isError()) {
     return Error("Failed to clone child process: " + child.error());