Skip to content

Commit

Permalink
Workaround a zombie process created by Open3
Browse files Browse the repository at this point in the history
with MJIT worker enabled

The problem:

```
$ ruby -ropen3 --jit -e 'Open3.capture2e("cmake") rescue nil;binding.irb'
irb(main)[01:0]> Process.waitall
=> [[10656, #<Process::Status: pid 10656 exit 127>]]

$ ruby -ropen3 -e 'Open3.capture2e("cmake") rescue nil;binding.irb'
irb(main)[01:0]> Process.waitall
=> []
```

Not sure why it's happening yet, but first I'd like to prevent trunk-mjit-wait
from failing like http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2929075.
  • Loading branch information
k0kubun committed May 10, 2020
1 parent 18f2249 commit a6f8589
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/rubygems/test_gem_ext_cmake_builder.rb
Expand Up @@ -14,6 +14,14 @@ def setup
_, status = Open3.capture2e('cmake')
skip 'cmake not present' unless status.success?
rescue Errno::ENOENT
# Open3.capture2e with ENOENT with JIT enabled leaves a zombie process.
# TODO: avoid making the zombie on ENOENT with JIT
if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
begin
Process.waitall
rescue Errno::ECHILD
end
end
skip 'cmake not present'
end

Expand Down

0 comments on commit a6f8589

Please sign in to comment.