> On April 3, 2014, 7:32 p.m., Dominic Hamon wrote: > > 3rdparty/libprocess/include/process/subprocess.hpp, line 79 > > <https://reviews.apache.org/r/19259/diff/2/?file=520575#file520575line79> > > > > It just feels a little restrictive, in that I might want to pass > > arguments. > > Benjamin Hindman wrote: > Since 'subprocess' will never be passing arguments to the function taking > 'void' is fine, you can bind your own arguments as his tests show.
Right, bind-override or bind-functor are options to get over this limitation. > On April 3, 2014, 7:32 p.m., Dominic Hamon wrote: > > 3rdparty/libprocess/src/subprocess.cpp, line 141 > > <https://reviews.apache.org/r/19259/diff/3/?file=548212#file548212line141> > > > > Change Envp to take an Option<map> and skip the loop over the passed in > > map if it's None()? > > Benjamin Hindman wrote: > I think it's fine to just do: > > internal::Envp envp(environment.get(map<string, string>())); > > As it captures the current semantics. We could add a TODO to optimize > Envp to not generate the environment for empty maps (or better a None) , but > I'm happy to just make that a TODO now and optimize later. Option::get(*default*) was new to me. Thanks for pointing this out Ben. I added that TODO with another point; which is to not use execle in the first place when Environment.isNone() as we are emulating what execl already does for us. > On April 3, 2014, 7:32 p.m., Dominic Hamon wrote: > > 3rdparty/libprocess/src/subprocess.cpp, lines 179-189 > > <https://reviews.apache.org/r/19259/diff/3/?file=548212#file548212line179> > > > > this isn't 'setup && command' as documented. If it was, we wouldn't run > > command if setup returned non-zero. > > Benjamin Hindman wrote: > Yes, see my comments re: using _exit. Ah, I got the initial plan entirely wrong here - never considered to just exit instead of exec'ing the command regardless. - Till ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/19259/#review37440 ----------------------------------------------------------- On April 3, 2014, 10:46 p.m., Till Toenshoff wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/19259/ > ----------------------------------------------------------- > > (Updated April 3, 2014, 10:46 p.m.) > > > Review request for mesos, Benjamin Hindman, Dominic Hamon, and Ian Downes. > > > Bugs: MESOS-1102 > https://issues.apache.org/jira/browse/MESOS-1102 > > > Repository: mesos-git > > > Description > ------- > > Adds the ability to process::subprocess to run a function (lambda) within the > child context, after fork and before exec. > > NOTE: Such lambda must not contain any async unsafe code. For details on > async safety, see POSIX.1-2004 on async-signal-safe functions, also > referenced in the signal man-pages: > http://man7.org/linux/man-pages/man7/signal.7.html. > > > Diffs > ----- > > 3rdparty/libprocess/include/process/subprocess.hpp 6c51c0b > 3rdparty/libprocess/src/subprocess.cpp e09c808 > 3rdparty/libprocess/src/tests/subprocess_tests.cpp 9413ecc > > Diff: https://reviews.apache.org/r/19259/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Till Toenshoff > >
