> On March 7, 2014, 3:35 a.m., Ben Mahler wrote: > > 3rdparty/libprocess/3rdparty/stout/include/stout/os/killtree.hpp, line 51 > > <https://reviews.apache.org/r/18595/diff/1/?file=506546#file506546line51> > > > > This seems a little strange, because we'll be trying to signal multiple > > times: > > > > root <- signaled 1 time > > child <- signaled 2 times > > grandchild <- signaled 3 times > > ... > > Nth level pid <- signaled N times > > > > Also, how will this be used? Let's say you use this for a 5 minute > > signal escalation on the tree originally returned by killtree(pid_t, int, > > bool, bool). 5 minutes later, how do you know the pids are still valid and > > you don't accidentally kill unrelated processes? > > Ben Mahler wrote: > Actually it's probably more productive to review r/18597 first. :) > > Niklas Nielsen wrote: > This RR was mostly to address killing orphan processes or in other words, > have a way to kill the processes that belong to a process tree root which > might shutdown before its children. With the current killtree implementation, > it seems to me that this would fail (the pid can't be resolved to a process > and returns). Till mentioned that we might end up killing new processes same > pids, which is a problem. > > I am not sure how we can address both; I'll take a second stab at it > tomorrow :) > > Till Toenshoff wrote: > Yep, I am a bit concerned about pid-reuse. As all our options are > poll-based (this approach in connection with RR18594 and a > delayed-continuation) as well as process::reaper, this approach seemed a bit > "safer" in regard to the polling period. process::reaper uses 1 second > whereas the use of this can be freely adjusted to smaller intervals (see > implementation of PluggableContainerizer's destroy escalation). In the end > however, all solutions we have so far appear to carry the risk of killing > unrelated (reused) pids. > > For the signal repetition on childs within the same pid session or group, > that indeed might be a great point and me might want to address it.
Just found some well-founded information on pid-reuse on linux: http://stackoverflow.com/questions/11323410/linux-pid-recycling - Till ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/18595/#review36486 ----------------------------------------------------------- On Feb. 28, 2014, 12:54 a.m., Niklas Nielsen wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/18595/ > ----------------------------------------------------------- > > (Updated Feb. 28, 2014, 12:54 a.m.) > > > Review request for mesos and Ben Mahler. > > > Repository: mesos-git > > > Description > ------- > > New killtree(ProcessTree tree, int signal) traverse process tree and sends a > signal to all pids. This is done regardless of presence and state of process. > Patch is used by up coming signal escalation. > > > Diffs > ----- > > 3rdparty/libprocess/3rdparty/stout/include/stout/os/killtree.hpp 1f45897 > > Diff: https://reviews.apache.org/r/18595/diff/ > > > Testing > ------- > > Functional testing with signal escalation code and make check. > > > Thanks, > > Niklas Nielsen > >