-
-
Notifications
You must be signed in to change notification settings - Fork 924
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
Unexpected behaviour of Process.waitpid...? #3117
Comments
Tried this on 9k also and it is a little better:
but still broken. So both branches have issue(s). |
I would guess that WNOHANG is not doing anything. Investigating. |
Nevermind, WNOHANG seems ok. We just weren't returning nil for a zero result from waitpid. Fixing. |
Fixed for 9k.rc2 and 1.7.22. |
@headius Thanks! |
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 9.0.1.0-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. Conflicts: core/src/main/java/org/jruby/RubyProcess.java
@Freaky Good catch! Fixed! |
test.rb:
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
It seems
Process.waitpid
returns zero instead ofnil
while the child process hasn't exited. Is this different behaviour known/expected?If it is, what is the best way to check that a child process is still running and has not exited yet? Simply
Process.waitpid(pid, Process::WNOHANG) == 0
?The text was updated successfully, but these errors were encountered: