> On Aug. 25, 2016, 5:34 p.m., Jie Yu wrote: > > src/slave/containerizer/mesos/launch.cpp, line 502 > > <https://reviews.apache.org/r/51406/diff/1/?file=1485376#file1485376line502> > > > > I'd avoid using subprocess here. Using subprocess here means that we'll > > initialize libprocess, creating many unnecessary threads. I would simply > > fork-exec here. We don't have two worry about async signal safe problem > > here because it's single threaded process. > > > > We need to fix the `pre_exec_comands` above for the same problem.
Not resolved? I'd still suggest you use 'fork-exec' as the code shown above. You can avoid the subprocess usage in that way. - Jie ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/51406/#review146791 ----------------------------------------------------------- On Aug. 25, 2016, 11:32 p.m., Kevin Klues wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/51406/ > ----------------------------------------------------------- > > (Updated Aug. 25, 2016, 11:32 p.m.) > > > Review request for mesos and Jie Yu. > > > Bugs: MESOS-6088 > https://issues.apache.org/jira/browse/MESOS-6088 > > > Repository: mesos > > > Description > ------- > > Previously the 'mesos-containerizer launch' binary would simply exec > into the actual command we wanted to launch after doing some set of > preperatory work. The problem with this approach, however, is that > this gives us no opportunity to checkpoint the exit status of the > command so the agent can recover it in cases where it is offline at > the time the command completes. > > To compensate for this, we now allow 'mesos-containerizer launch' to > take an optional '--exit_status_path' parameter, which indicates where > the exit status of our command should be checkpointed. In order to > do this checkpointing, however, we cannot simply exec into the command > anymore. Instead we now fork-exec the command and reap it once it > completes. We then checkpoint its exit status and return it as our > own. We call the original process the 'init' process of the container > and the fork-exec'd process its child. As a side effect of doing > things this way, we also have to be careful to forward all signals > sent to the init process down to the child. > > In a subsequent commit we will update the mesos containerizer to use > this new functionality. > > > Diffs > ----- > > src/slave/containerizer/mesos/launch.hpp > 0e86da9c7bd9c7fbedd7102d66b902d1c10e5e0b > src/slave/containerizer/mesos/launch.cpp > 2db8db5ac2f4614d406b950a1b4e8098a0d90e7b > src/slave/containerizer/mesos/launcher.cpp > 413a8afdc56127a58c9599c436d17d6c98e62434 > src/slave/containerizer/mesos/linux_launcher.cpp > 7377316776646e3d660086da3c0d5b494ce8ace4 > > Diff: https://reviews.apache.org/r/51406/diff/ > > > Testing > ------- > > > Thanks, > > Kevin Klues > >
