You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2016/06/15 17:07:25 UTC
[7/7] mesos git commit: Windows: Added `src/executor/executor.cpp`.
Windows: Added `src/executor/executor.cpp`.
Windows: Added `src/executor/executor.cpp`.
Review: https://reviews.apache.org/r/48004/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/26b175d7
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/26b175d7
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/26b175d7
Branch: refs/heads/master
Commit: 26b175d7879a0ef90a0192db76bf072323a3a597
Parents: f5f87ec
Author: Alex Clemmer <cl...@gmail.com>
Authored: Wed Jun 15 16:31:38 2016 +0200
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Wed Jun 15 19:06:59 2016 +0200
----------------------------------------------------------------------
src/executor/executor.cpp | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/26b175d7/src/executor/executor.cpp
----------------------------------------------------------------------
diff --git a/src/executor/executor.cpp b/src/executor/executor.cpp
index fd2d0cd..6ab4c3f 100644
--- a/src/executor/executor.cpp
+++ b/src/executor/executor.cpp
@@ -108,10 +108,19 @@ protected:
{
VLOG(1) << "Committing suicide by killing the process group";
+#ifndef __WINDOWS__
// TODO(vinod): Invoke killtree without killing ourselves.
// Kill the process group (including ourself).
killpg(0, SIGKILL);
-
+#else
+ LOG(WARNING) << "Shutting down process group. Windows does not support "
+ "`killpg`, so we simply call `exit` on the assumption "
+ "that the process was generated with the "
+ "`MesosContainerizer`, which uses the 'close on exit' "
+ "feature of job objects to make sure all child processes "
+ "are killed when a parent process exits";
+ exit(0);
+#endif // __WINDOWS__
// The signal might not get delivered immediately, so sleep for a
// few seconds. Worst case scenario, exit abnormally.
os::sleep(Seconds(5));