[
https://issues.apache.org/jira/browse/MESOS-5807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16135886#comment-16135886
]
Andrew Schwartzmeyer commented on MESOS-5807:
---------------------------------------------
Actually, I think I already finished this.
The current logic is:
{noformat}
LOG(INFO) << "Starting task " << taskId.get();
pid = launchTaskSubprocess(
command,
launcherDir,
launchEnvironment,
user,
rootfs,
sandboxDirectory,
workingDirectory,
effectiveCapabilities,
boundingCapabilities);
LOG(INFO) << "Forked command at " << pid;
{noformat}
The {{job_object}} logic is encapsulated inside {{launchTaskSubprocess}}.
This was done in:
{noformat}
commit 0f812d681
Author: Andrew Schwartzmeyer <[email protected]>
Date: Mon Apr 3 14:20:52 2017 -0700
Refactored command executor to unify launch paths.
This commit reverses the file split done in e821978.
Since `launchTaskPosix` and `launchTaskWindows` were reconciled
using `Subprocess`, the files were pulled back into just
`src/launcher/executor.cpp` with `launchTaskSubprocess`.
Review: https://reviews.apache.org/r/57976/
{noformat}
> Support job_object in subprocess on Windows.
> --------------------------------------------
>
> Key: MESOS-5807
> URL: https://issues.apache.org/jira/browse/MESOS-5807
> Project: Mesos
> Issue Type: Improvement
> Reporter: Jie Yu
> Assignee: Andrew Schwartzmeyer
>
> Currently, in command executor, we use different code path for posix and
> windows:
> {noformat}
> #ifndef __WINDOWS__
> pid = launchTaskPosix(
> command,
> launcherDir,
> user,
> rootfs,
> sandboxDirectory,
> workingDirectory);
> #else
> // A Windows process is started using the `CREATE_SUSPENDED` flag
> // and is part of a job object. While the process handle is kept
> // open the reap function will work.
> PROCESS_INFORMATION processInformation = launchTaskWindows(
> command,
> rootfs);
> pid = processInformation.dwProcessId;
> ::ResumeThread(processInformation.hThread);
> CloseHandle(processInformation.hThread);
> processHandle = processInformation.hProcess;
> #endif
> {noformat}
> During a recent refactor (MESOS-5753), for the posix path, command executor
> reused `mesos-containerizer launch` helper to launch user tasks.
> If we were to be able to support job_object in Subprocess, we can get rid of
> this divergence in command executor. This also allow us to support custom
> executors on Windows.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)