You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by "Jie Yu (JIRA)" <ji...@apache.org> on 2014/04/08 02:54:16 UTC

[jira] [Updated] (MESOS-1197) Adding signal safe os::system

     [ https://issues.apache.org/jira/browse/MESOS-1197?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jie Yu updated MESOS-1197:
--------------------------

    Description: 
There exist a few scenarios in which we need to execute a shell command inside the child context (has to be signal safe). For example, in this review:
https://reviews.apache.org/r/20026/

However, the existing os::system is not async signal safe because ::system is not async signal safe. The main issue is because ::system has to deal with signal semantics:

{noformat}
The system() function hands the argument command to the command interpreter sh(1).
The calling process waits for the shell to finish executing the command, ignoring SIGINT
and SIGQUIT, and blocking SIGCHLD.
{noformat}

We have two options here:

1) make the existing os::system signal safe, but it's semantics will be slightly different from ::system

2) add a new function: os::safeSystem

Let me know your thoughts!

  was:
There exist a few scenarios in which we need to execute a shell command inside the child context (has to be signal safe). For example, in this review:
https://reviews.apache.org/r/20026/

However, the existing os::system is not async signal safe because ::system is not async signal safe. The main issue is because ::system has to deal with signal semantics:

{noformat}
The system() function hands the argument command to the command interpreter sh(1). The calling process waits for the shell to finish executing the command, ignoring SIGINT and SIGQUIT, and blocking SIGCHLD.
{noformat}

We have two options here:

1) make the existing os::system signal safe, but it's semantics will be slightly different from ::system

2) add a new function: os::safeSystem

Let me know your thoughts!


> Adding signal safe os::system
> -----------------------------
>
>                 Key: MESOS-1197
>                 URL: https://issues.apache.org/jira/browse/MESOS-1197
>             Project: Mesos
>          Issue Type: Task
>            Reporter: Jie Yu
>
> There exist a few scenarios in which we need to execute a shell command inside the child context (has to be signal safe). For example, in this review:
> https://reviews.apache.org/r/20026/
> However, the existing os::system is not async signal safe because ::system is not async signal safe. The main issue is because ::system has to deal with signal semantics:
> {noformat}
> The system() function hands the argument command to the command interpreter sh(1).
> The calling process waits for the shell to finish executing the command, ignoring SIGINT
> and SIGQUIT, and blocking SIGCHLD.
> {noformat}
> We have two options here:
> 1) make the existing os::system signal safe, but it's semantics will be slightly different from ::system
> 2) add a new function: os::safeSystem
> Let me know your thoughts!



--
This message was sent by Atlassian JIRA
(v6.2#6252)