Fix ChildProcess::Unix::Process#exited? method with leader processes #154
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sorry, I found another edge case following on from my leader-process problems in #151
When child2.stop is called, we send it TERM, then poll for it to exit with
::Process.waitpid2(_pid, ::Process::WNOHANG | ::Process::WUNTRACED)
. The process dies straight away, but under ruby 2.6, that waitpid2 call always returnsnil
, until we hit the stop-timeout, at which point we sent the child a KILL.In OS X, that KILL raises
Errno::EPERM
. In Linux, it seems like it just swallows the signal being sent to a dead process.WDYT to this fix? I'm not really familiar with unix leader process, so would welcome additional scrutiny.