Unexpected behaviour of Process.waitpid...? #3117
pid = Process.spawn("sleep 3") puts Process.waitpid(pid, Process::WNOHANG).nil? sleep 6 puts Process.waitpid(pid, Process::WNOHANG).nil?
Executing the script above with Ruby v2.2.2 produces the following output:
And executing it with JRuby v1.7.20 produces this:
false Errno::ECHILD: No child processes - No child processes waitpid at org/jruby/RubyProcess.java:536 waitpid at org/jruby/RubyProcess.java:521 (root) at test.rb:4
If it is, what is the best way to check that a child process is still running and has not exited yet? Simply
The text was updated successfully, but these errors were encountered:
e3e7dd7 Improve Thread#wakeup spec 99bb111 Remove outdated spec c131731 Add missing stdlib require 69e04f0 Add spec for waitpid(... WNOHANG) returning nil. #3117. 48f098d Be more precise in Module#prepend example 0f05e29 Add spec for Module#prepend 14f4954 Add a spec to ensure Module#prepended is called by #prepend 7030731 Add missing cases to BigDecimal#div specs 5db8638 Make the path for a UNIX domain socket shorter as it is quite limited on Linux 3874369 Add proper before/after blocks for a File.socket? spec f0b29f8 Clarify where class variables get defined 1b3b3ce Add spec for Binding#local_variable_set. git-subtree-dir: spec/ruby git-subtree-split: e3e7dd78ef23b08af2447701ea4f6e51c4b104a1
* jruby-1_7: (36 commits) no need for "" + ... keep the test Java 6 compilable + more asserts method cache hash calc needs to acount for Proc support for matching proc-to-iface methods by arity improve resolving functional-interfaces avoid reflection in getFunctionalInterface some Java.getFunctionalInterfaceMethod asserts introduce a getFunctionalInterfaceMethod helper generix-ize some of JavaUtil's static helpers Make sure windows files generate signatures as part of post_process_artifacts Doh...how did this not get added Fixes #3135. Provide sha256 sums yet another multiple args proc-to-iface spec less deprecation warnings from implementation_spec clean + avoid deprecation warn in executor_spec less rspec deprecation warnings from ant spec avoid File#listFiles in spec since it's ambiguous spec for regression in proc to iface optimization Fix references to old mailing lists. Return nil when waitpid returns 0. Fixes #3117. ... Conflicts: VERSION antlib/extra.xml core/pom.xml core/src/main/java/org/jruby/RubyProcess.java core/src/main/java/org/jruby/embed/util/SystemPropertyCatcher.java core/src/test/java/org/jruby/embed/ScriptingContainerTest.java docs/man/pom.xml docs/pom.xml ext/pom.xml ext/readline/pom.xml ext/ripper/pom.xml lib/pom.xml maven/jruby-complete/pom.xml maven/jruby-dist/pom.xml maven/jruby-dist/src/main/assembly/jruby.xml maven/jruby-jars/pom.xml maven/jruby-noasm/pom.xml maven/jruby-rake-plugin/pom.xml maven/jruby-stdlib/pom.xml maven/jruby/pom.xml maven/pom.xml pom.xml test/pom.xml test/test_backquote.rb test/test_kernel.rb
I think you missed fixing
jruby 18.104.22.168-SNAPSHOT (2.2.2) 2015-08-01 6a9fcf8 OpenJDK 64-Bit Server VM 25.51-b03 on 1.8.0_51-b16 +jit [FreeBSD-amd64]
Missed fix for #3117.
Missed fix for #3117. Conflicts: core/src/main/java/org/jruby/RubyProcess.java