> On June 15, 2013, 11:33 p.m., Benjamin Hindman wrote:
> > This is pretty darn clean and simple! Happy to see killtree.sh go away, but 
> > we should consider updating the Stout Makefile to build a 'killtree' binary 
> > to enable other people to easily use killtree from the command line! In 
> > fact, it might be nice to ship/install something like that with Mesos.
> > 
> > Also, I'm a big +1 for capturing output for debugging purposes. Given the 
> > nature of this being in stout, what about taking a std::ostream that this 
> > function uses (similar to os::shell) and then passing '&LOG(INFO)' when we 
> > use this in ProcessIsolator? I'd love to see that before this is committed.

Added output, here's an example on Linux:
[ RUN      ] OsTest.killtree
Performing killtree operation on 29892
Stopped 29892
  Children of 29892: { 29893 }
  Members of group 29892: { 29892, 29893, 29894 }
  Members of session 29892: { 29892, 29893, 29894 }
Stopped 29893
  Children of 29893: {  }
  Members of group 29892: { 29892, 29893, 29894 }
  Members of session 29892: { 29892, 29893, 29894 }
Stopped 29894
  Children of 29894: { 29895 }
  Members of group 29892: { 29892, 29893, 29894 }
  Members of session 29892: { 29892, 29893, 29894 }
Stopped 29895
  Children of 29895: {  }
  Members of group 29895: { 29895 }
  Members of session 29895: { 29895 }
Signaled 29892
Signaled 29893
Signaled 29894
Signaled 29895

And OSX:
[ RUN      ] OsTest.killtree
Performing killtree operation on 57549
Stopped 57549
  Children of 57549: { 57550 }
  Members of group 57549: { 57549, 57550, 57551 }
  Members of session 57549: { 57549, 57551 }
Stopped 57550
  Children of 57550: {  }
Stopped 57551
  Children of 57551: { 57552 }
  Members of group 57549: { 57549, 57550, 57551 }
  Members of session 57549: { 57549, 57551 }
Stopped 57552
  Children of 57552: {  }
  Members of group 57552: { 57552 }
  Members of session 57552: { 57552 }
Signaled 57549
Signaled 57550
Signaled 57551
Signaled 57552


> On June 15, 2013, 11:33 p.m., Benjamin Hindman wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/os/killtree.hpp, line 79
> > <https://reviews.apache.org/r/11849/diff/1/?file=304306#file304306line79>
> >
> >     I think I'm a +1 for 'visited'. Basically this is preorder BFS where 
> > the "visiting" component is to do the stop, so knowing that you've 
> > "visited" implies that you've already sent a stop.
> >     
> >     Also, in a BFS you wouldn't have to check if you already visited (you'd 
> > just add all the children), so I think a comment here explaining that we 
> > need to check if the process has been already visited since we might have 
> > already added the process (and thus visited it) via the group or session 
> > lookups.

Fixed, however the comment you described is only applicable to the current code 
so I have not added it. This is now a standard BFS implementation.


> On June 15, 2013, 11:33 p.m., Benjamin Hindman wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/os/killtree.hpp, line 121
> > <https://reviews.apache.org/r/11849/diff/1/?file=304306#file304306line121>
> >
> >     What are the possible errors? Is this forward looking?

Forward looking, do you think I should remove the Try for now?


- Ben


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/11849/#review21951
-----------------------------------------------------------


On June 18, 2013, 4:42 a.m., Ben Mahler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/11849/
> -----------------------------------------------------------
> 
> (Updated June 18, 2013, 4:42 a.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Vinod Kone.
> 
> 
> Description
> -------
> 
> For how killtree will be used, see the killtree.sh script in mesos.
> 
> This version is actually more robust than killtree.sh, as it first stops the 
> entire tree, _then_ issues the signal.
> Currently, killtree.sh stops, signals, and continues each process in 
> isolation.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/Makefile.am 
> 2b7ee9c099a28dc5e482d7609e6307f2b6398e8b 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp 
> 1b3fb47d7567b5467fef2a2bb15d5c4a2ea42aa5 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os/killtree.hpp 
> PRE-CREATION 
>   3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp 
> 73b2336e93d6e5aac97e2c18e8e36c258c56a420 
> 
> Diff: https://reviews.apache.org/r/11849/diff/
> 
> 
> Testing
> -------
> 
> Added a test, however this test can be _significantly_ cleaned up were we to 
> create an abstraction for generating process trees!
> 
> 
> Thanks,
> 
> Ben Mahler
> 
>

Reply via email to