> On Feb. 8, 2017, 2:26 a.m., Joseph Wu wrote: > > I need to check how this is used in the rest of the review chain, but... > > > > Giving the ownership of the HANDLE to the caller may require much larger > > changes in the codebase. You may notice that we simply leak some pid's in > > some parts of the codebase. So we have to make sure we aren't leaking > > these shared objects.
I'm not sure I understand, actually. Just so we're on the same page, right now we leak the Job Object handles because they're set to kill the corresponding Job when the last handle is closed -- in other words, when the Agent dies. So any time the agent dies, all of our Executors die, too. :( One of the goals of this patch is to set the stage so the agent and executor lifecycles _can_ be decoupled, so that when the agent dies, it can recover and reconnect to the running Executors instead of simply killing them all and restarting them. This implies that the agent should be managing the lifecycle of the Job Objects, which in particular seems to imply that it is convenient to keep those handles (or _some_ sort of ID) as state. Make sense? - Alex ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/56364/#review164619 ----------------------------------------------------------- On Feb. 7, 2017, 2:31 a.m., Andrew Schwartzmeyer wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/56364/ > ----------------------------------------------------------- > > (Updated Feb. 7, 2017, 2:31 a.m.) > > > Review request for mesos, Alex Clemmer and Joseph Wu. > > > Bugs: MESOS-6892 > https://issues.apache.org/jira/browse/MESOS-6892 > > > Repository: mesos > > > Description > ------- > > `os::create_job` now returns a `Try<SharedHandle>` instead of a raw > `HANDLE`, forcing ownership of the job object handle onto the caller > of the function. `create_job` requires a `std::string name` for the > job object, which is mapped from a PID using `os::name_job`. > > The assignment of a process to the job object is now done via > `Try<Nothing> os::assign_job(SharedHandle, pid_t)`. > > The equivalent of killing a process tree with job object semantics > is simply to terminate the job object. This is done via > `os::kill_job(SharedHandle)`. > > > Diffs > ----- > > 3rdparty/stout/include/stout/windows/os.hpp > b5172fca96c4151f4b1ebb6d343022558f45fc34 > > Diff: https://reviews.apache.org/r/56364/diff/ > > > Testing > ------- > > > Thanks, > > Andrew Schwartzmeyer > >
