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

fix: actually turn off child subreaping in reaper.Stop #454

Merged
merged 2 commits into from
Jul 19, 2024

Conversation

benhoyt
Copy link
Contributor

@benhoyt benhoyt commented Jul 17, 2024

Previously we weren't actually turning off child subreaping at the OS level in reaper.Stop, so it didn't reverse reaper.Start. Fix this, and also simplify the error handling a little.

This almost certainly didn't cause problems, because as soon as the Pebble process exits it doesn't matter. But it wouldn't have turned it off in tests, and it's just the Right Thing To Do.

Fixes #412

@benhoyt benhoyt requested a review from flotter July 17, 2024 23:14
@@ -75,22 +73,28 @@ func Stop() error {
started = false
mutex.Unlock()

err := setChildSubreaper(0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be theoretically safer to disable receiving unix.SIGCHLD signals, before we terminate the processing loop that deals with them ?

Copy link
Contributor

@flotter flotter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Just the one question :)

@benhoyt
Copy link
Contributor Author

benhoyt commented Jul 19, 2024

Yep, fair point -- fixed.

@benhoyt benhoyt merged commit 6bbc91a into canonical:master Jul 19, 2024
11 checks passed
@benhoyt benhoyt deleted the fix-reaper-stop branch July 19, 2024 02:25
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.

Turn off child subreaper at OS level in reaper.Stop
2 participants