-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Milestone
Description
it seems like jruby automatically reaps child pids. This is different from MRI.
The following script demonstrates this.
pid = Process.spawn 'cat' # waits forever
Process.kill 15, pid
Process.wait pid
puts 'all is good'When run with MRI I get:
$ ruby test.rb
all is good
When I run it with jruby I get:
$ jruby test.rb
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=lcd
Errno::ECHILD: No child processes - No child processes
waitpid at org/jruby/RubyProcess.java:536
wait at org/jruby/RubyProcess.java:563
wait at org/jruby/RubyProcess.java:558
(root) at test.rb:3
This is not always the case, sometimes I get:
$ jruby test.rb
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=lcd
all is good
I am running the following versions:
$ ruby --version
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
$ jruby --version
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=lcd
jruby 1.7.18 (1.9.3p551) 2014-12-22 625381c on Java HotSpot(TM) 64-Bit Server VM 1.8.0_31-b13 +jit [linux-amd64]
I am guessing that either jruby or the jvm automatically reaps it's children. When I get the error, it's when the child was reaped before I could call Process#kill. When I don't get the error, it's because I managed to call Process#wait before the child process was automatically reaped.
Reactions are currently unavailable