Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the signal mask before forking #104

Merged
merged 1 commit into from
Jul 26, 2016

Conversation

chriskuehl
Copy link
Contributor

Fixes #102

We don't currently set the signal mask before forking. If the child process exits very quickly (probably most probable when the child fails to exec, which is the test we saw it in), the parent might receive SIGCHLD before it has set the mask and thus never wait on the child.

Any suggestions on writing tests for this? It's a hard race to force (it takes about 5000 spawns of dumb-init on my machine).

After this change I haven't been able to reproduce after 100,000 spawns. This is also what some other init systems do, such as sinit.

@asottile
Copy link
Contributor

I can't think of a good way to test this, looks good to me though /me merges

@asottile asottile merged commit 74bdd54 into Yelp:master Jul 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants