> On April 20, 2016, 7:05 p.m., Joris Van Remoortere wrote:
> > 3rdparty/libprocess/src/reap.cpp, lines 98-106
> > <https://reviews.apache.org/r/46341/diff/2/?file=1353396#file1353396line98>
> >
> >     Does this logic still work the same way, now that we are using `Result`?
> >     Are we handling the `Error` and `None` states the same?

Unless I'm missing something completely obvious, I believe the answer is yes, 
and we do have tests to cover this. [1] indicates that the possible return 
values are `-1`, `0`, numbers `> 0`. We map `-1` to `Error`, we map `0` to 
`None`, and we map numbers `> 0` to `Some` of `pid_t`.

If you change `if (child_pid.isSome())`, you will see other tests fail. For 
example, if you change this line to `if (!child_pid.isNone())`, then 
`ReapTest.NonChildProcess` fails. Alternatively, on Windows, 
`PipeOutputToFileDescriptor` from review 46424[2] would call `notify` and emit 
`STILL_ACTIVE`, which in conjunction with `WIFEXITSTATUS` would emit some 
weirdo exit code `0xFF & STILL_ACTIVE`, even though the process was not reaped.

Does this answer your question?

[1] http://linux.die.net/man/2/waitpid
[2] https://reviews.apache.org/r/46424/


- Alex


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


On April 20, 2016, 4:37 p.m., Alex Clemmer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46341/
> -----------------------------------------------------------
> 
> (Updated April 20, 2016, 4:37 p.m.)
> 
> 
> Review request for mesos, Alex Naparu, Daniel Pravat, Artem Harutyunyan, 
> Joris Van Remoortere, Michael Park, M Lawindi, and Yi Sun.
> 
> 
> Bugs: MESOS-4466
>     https://issues.apache.org/jira/browse/MESOS-4466
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Stout:[2/2] Transitioned reap.cpp to `os::waitpid`.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/src/reap.cpp 110386842d5eeccfbc4e48bfca88d79a9d087fb0 
> 
> Diff: https://reviews.apache.org/r/46341/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Alex Clemmer
> 
>

Reply via email to