[
https://issues.apache.org/jira/browse/MESOS-8170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
James Peach updated MESOS-8170:
-------------------------------
Description:
There's no consistent methodology in lib process or Mesos for propagating
errors that happen between fork and exec. For
[posix_spawn|http://pubs.opengroup.org/onlinepubs/009695399/functions/posix_spawn.html],
the POSIX standard designated an exit code or 127 to identify this case. We
should adopt the same convention.
{quote}
The 8 bits of child process exit status that are guaranteed by IEEE Std
1003.1-2001 to be accessible to the waiting parent process are insufficient to
disambiguate a spawn error from any other kind of error that may be returned by
an arbitrary process image. No other bits of the exit status are required to be
visible in stat_val, so these macros could not be strictly implemented at the
library level. Reserving an exit status of 127 for such spawn errors is
consistent with the use of this value by system() and popen() to signal
failures in these operations that occur after the function has returned but
before a shell is able to execute. The exit status of 127 does not uniquely
identify this class of error, nor does it provide any detailed information on
the nature of the failure. Note that a kernel implementation of posix_spawn()
or posix_spawnp() is permitted (and encouraged) to return any possible error as
the function value, thus providing more detailed failure information to the
parent process.
Thus, no special macros are available to isolate asynchronous posix_spawn() or
posix_spawnp() errors. Instead, errors detected by the posix_spawn() or
posix_spawnp() operations in the context of the child process before the new
process image executes are reported by setting the child's exit status to 127.
The calling process may use the WIFEXITED and WEXITSTATUS macros on the
stat_val stored by the wait() or waitpid() functions to detect spawn failures
to the extent that other status values with which the child process image may
exit (before the parent can conclusively determine that the child process image
has begun execution) are distinct from exit status 127.
{quote}
> Propagate exit status 127 for errors after fork
> -----------------------------------------------
>
> Key: MESOS-8170
> URL: https://issues.apache.org/jira/browse/MESOS-8170
> Project: Mesos
> Issue Type: Bug
> Components: libprocess
> Reporter: James Peach
>
> There's no consistent methodology in lib process or Mesos for propagating
> errors that happen between fork and exec. For
> [posix_spawn|http://pubs.opengroup.org/onlinepubs/009695399/functions/posix_spawn.html],
> the POSIX standard designated an exit code or 127 to identify this case. We
> should adopt the same convention.
> {quote}
> The 8 bits of child process exit status that are guaranteed by IEEE Std
> 1003.1-2001 to be accessible to the waiting parent process are insufficient
> to disambiguate a spawn error from any other kind of error that may be
> returned by an arbitrary process image. No other bits of the exit status are
> required to be visible in stat_val, so these macros could not be strictly
> implemented at the library level. Reserving an exit status of 127 for such
> spawn errors is consistent with the use of this value by system() and popen()
> to signal failures in these operations that occur after the function has
> returned but before a shell is able to execute. The exit status of 127 does
> not uniquely identify this class of error, nor does it provide any detailed
> information on the nature of the failure. Note that a kernel implementation
> of posix_spawn() or posix_spawnp() is permitted (and encouraged) to return
> any possible error as the function value, thus providing more detailed
> failure information to the parent process.
> Thus, no special macros are available to isolate asynchronous posix_spawn()
> or posix_spawnp() errors. Instead, errors detected by the posix_spawn() or
> posix_spawnp() operations in the context of the child process before the new
> process image executes are reported by setting the child's exit status to
> 127. The calling process may use the WIFEXITED and WEXITSTATUS macros on the
> stat_val stored by the wait() or waitpid() functions to detect spawn failures
> to the extent that other status values with which the child process image may
> exit (before the parent can conclusively determine that the child process
> image has begun execution) are distinct from exit status 127.
> {quote}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)