Skip to content
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

"Errno::ECHILD: No child processes" on JRuby #341

Open
jasonrclark opened this issue Aug 22, 2015 · 9 comments
Open

"Errno::ECHILD: No child processes" on JRuby #341

jasonrclark opened this issue Aug 22, 2015 · 9 comments

Comments

@jasonrclark
Copy link

Updating the Guardfile on Shoes 4 after the project reshuffled its files, and unfortunately started seeing some consistent crashes. It's been quite a while since I actively ran Guard on the project, so I don't know precisely when the problem crept in.

Fortunately, I reproduced the problem with a slimmed down test repository at https://github.com/jasonrclark/jruby-guard-rspec. I ran a similar minimal test for guard-minitest, and it didn't have the same failure, so guard-rspec seemed a reasonable place to start given that.

To run the sample, clone https://github.com/jasonrclark/jruby-guard-rspec and using JRuby run:

bundle exec guard -i -d

The effect seems to be:

  • First time I save spec/test_spec.rb file, I don't see Guard to anything
  • Second time I save it, the tests will run, but then I get an error (appended below)
  • Subsequent saves don't seem to run anything at all.

Versions:

  • jruby 1.7.20.1 (1.9.3p551) 2015-06-10 d7c8c27 on Java HotSpot(TM) 64-Bit Server VM 1.8.0_20-b26 [darwin-x86_64]
  • guard (2.13.0)
  • guard-rspec (4.6.4)
  • rspec (3.3.0)
  • Mac OS X, 10.10.5

Log from failure:

22:31:28 - DEBUG - Notiffany: gntp not available (Please add "gem 'ruby_gntp'" to your Gemfile and run your app with "bundle exec".).
22:31:28 - DEBUG - Notiffany: growl not available (Please add "gem 'growl'" to your Gemfile and run your app with "bundle exec".).
22:31:28 - DEBUG - Notiffany: terminal_notifier not available (Please add "gem 'terminal-notifier-guard'" to your Gemfile and run your app with "bundle exec".).
22:31:28 - DEBUG - Notiffany: libnotify not available (Unsupported platform "darwin").
22:31:28 - DEBUG - Notiffany: notifysend not available (Unsupported platform "darwin").
22:31:28 - DEBUG - Notiffany: notifu not available (Unsupported platform "darwin").
22:31:28 - DEBUG - Command execution: {"ALTERNATE_EDITOR"=>"false"} emacsclient --eval '1'
22:31:28 - DEBUG - Notiffany: emacs not available (Emacs client failed).
22:31:28 - DEBUG - Notiffany: tmux not available (:tmux notifier is only available inside a TMux session.).
22:31:28 - DEBUG - Notiffany: file not available (No :path option given).
22:31:28 - DEBUG - Notiffany is using TerminalTitle to send notifications.
The signal USR1 is in use by the JVM and will not work correctly on this platform
22:31:28 - DEBUG - Guard starts all plugins
22:31:28 - DEBUG - Hook :start_begin executed for Guard::RSpec
22:31:28 - INFO - Guard::RSpec is running
22:31:28 - DEBUG - Hook :start_end executed for Guard::RSpec
22:31:28 - INFO - Guard is now watching at '/Users/jclark/source/jruby-guard-rspec'
22:31:28 - DEBUG - Guards jobs done. Sleeping...

# At this point I did the first save...
22:31:33 - DEBUG - Sleep interrupted by events.
22:31:33 - DEBUG - Guards jobs done. Sleeping...

# At this point I did the second save...
22:31:38 - DEBUG - Sleep interrupted by events.
22:31:38 - DEBUG - Hook :run_on_modifications_begin executed for Guard::RSpec
22:31:38 - INFO - Running: spec/test_spec.rb
.

Finished in 0.128 seconds (files took 1.47 seconds to load)
1 example, 0 failures

22:31:41 - ERROR - Guard::RSpec failed to achieve its <run_on_modifications>, exception was:
> [#] Errno::ECHILD: No child processes - No child processes
> [#] org/jruby/RubyProcess.java:728:in `waitpid2'
> [#] org/jruby/RubyProcess.java:777:in `wait2'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec/rspec_process.rb:39:in `_really_run'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec/rspec_process.rb:28:in `_run'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec/rspec_process.rb:53:in `_without_bundler_env'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/bundler-1.10.3/lib/bundler.rb:245:in `with_clean_env'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/bundler-1.10.3/lib/bundler.rb:232:in `with_original_env'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/bundler-1.10.3/lib/bundler.rb:238:in `with_clean_env'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec/rspec_process.rb:53:in `_without_bundler_env'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec/rspec_process.rb:27:in `_run'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec/rspec_process.rb:16:in `initialize'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec/runner.rb:68:in `_really_run'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec/runner.rb:57:in `_run'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec/runner.rb:41:in `run'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec.rb:42:in `run_on_modifications'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec.rb:48:in `_throw_if_failed'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec.rb:42:in `run_on_modifications'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-2.13.0/lib/guard/runner.rb:82:in `_supervise'
> [#] org/jruby/RubyKernel.java:1274:in `catch'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-2.13.0/lib/guard/runner.rb:79:in `_supervise'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-2.13.0/lib/guard/runner.rb:61:in `run_on_changes'
> [#] org/jruby/RubyHash.java:1341:in `each'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-2.13.0/lib/guard/runner.rb:56:in `run_on_changes'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-2.13.0/lib/guard/runner.rb:119:in `_run_group_plugins'
> [#] org/jruby/RubyArray.java:1613:in `each'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-2.13.0/lib/guard/runner.rb:117:in `_run_group_plugins'
> [#] org/jruby/RubyKernel.java:1274:in `catch'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-2.13.0/lib/guard/runner.rb:116:in `_run_group_plugins'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-2.13.0/lib/guard/runner.rb:54:in `run_on_changes'
> [#] org/jruby/RubyArray.java:1613:in `each'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-2.13.0/lib/guard/runner.rb:53:in `run_on_changes'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-2.13.0/lib/guard/internals/queue.rb:23:in `process'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-2.13.0/lib/guard/commander.rb:43:in `start'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-2.13.0/lib/guard/cli/environments/valid.rb:16:in `start_guard'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-2.13.0/lib/guard/cli.rb:122:in `start'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-2.13.0/lib/guard/aruba_adapter.rb:32:in `execute'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-2.13.0/lib/guard/aruba_adapter.rb:19:in `execute!'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-2.13.0/bin/_guard-core:11:in `(root)'
22:31:41 - INFO - Guard::RSpec has just been fired
22:31:41 - DEBUG - Guards jobs done. Sleeping...
@e2
Copy link
Contributor

e2 commented Aug 22, 2015

Looks like guard-rspec command is failing.

Could you patch:

/Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec/rspec_process.rb:39

to output the command (and possibly environment) - I believe running that command should reproduce the error, e.g:

      def _really_run
        env = { "GUARD_RSPEC_RESULTS_FILE" => formatter_tmp_file }
        STDERR.puts command.inspect
        STDERR.puts env.inspect
        pid = Kernel.spawn(env, command) # use spawn to stub in JRuby
        result = ::Process.wait2(pid)

Sorry about this - Guard traces calls to system, but not to spawn (yet), so it doesn't show the full command line used to run RSpec.

What's happening here is: rspec is failing almost immediately, and guard-rspec isn't (yet) patched to handle this edge cases.

I'll need to patch both guard and guard-rspec to fix this, but meanwhile running rspec with the same command line and arguments should show you exactly what's wrong.

@e2
Copy link
Contributor

e2 commented Aug 22, 2015

BTW, it works for me (your test repo - exact same JRuby version even)

@e2
Copy link
Contributor

e2 commented Aug 22, 2015

Guard on master now should properly trace the call, so you don't need the patching.

Still, I'm curious why your RSpec is failing (basically, so I can create a real-life based spec for this).

@jasonrclark
Copy link
Author

Thanks for the quick reply!

Transcript from a session is below running against master. Interestingly, my second save which typically would fail was ok, but then the third afterward gave the same failure. I wonder if something is sensitive to timing in this, which might explain why it works for you and (slightly inconsistently) for me.

~/source/jruby-guard-rspec:bundle exec guard -i -d
09:34:14 - DEBUG - Notiffany: gntp not available (Please add "gem 'ruby_gntp'" to your Gemfile and run your app with "bundle exec".).
09:34:14 - DEBUG - Notiffany: growl not available (Please add "gem 'growl'" to your Gemfile and run your app with "bundle exec".).
09:34:14 - DEBUG - Notiffany: terminal_notifier not available (Please add "gem 'terminal-notifier-guard'" to your Gemfile and run your app with "bundle exec".).
09:34:14 - DEBUG - Notiffany: libnotify not available (Unsupported platform "darwin").
09:34:14 - DEBUG - Notiffany: notifysend not available (Unsupported platform "darwin").
09:34:14 - DEBUG - Notiffany: notifu not available (Unsupported platform "darwin").
09:34:14 - DEBUG - Command execution: {"ALTERNATE_EDITOR"=>"false"} emacsclient --eval '1'
09:34:14 - DEBUG - Notiffany: emacs not available (Emacs client failed).
09:34:14 - DEBUG - Notiffany: tmux not available (:tmux notifier is only available inside a TMux session.).
09:34:14 - DEBUG - Notiffany: file not available (No :path option given).
09:34:14 - DEBUG - Notiffany is using TerminalTitle to send notifications.
The signal USR1 is in use by the JVM and will not work correctly on this platform
09:34:14 - DEBUG - Guard starts all plugins
09:34:14 - DEBUG - Hook :start_begin executed for Guard::RSpec
09:34:14 - INFO - Guard::RSpec is running
09:34:14 - DEBUG - Hook :start_end executed for Guard::RSpec
09:34:15 - INFO - Guard is now watching at '/Users/jclark/source/jruby-guard-rspec'
09:34:15 - DEBUG - Guards jobs done. Sleeping...
09:34:31 - DEBUG - Sleep interrupted by events.
09:34:31 - DEBUG - Guards jobs done. Sleeping...
09:34:36 - DEBUG - Sleep interrupted by events.
09:34:36 - DEBUG - Hook :run_on_modifications_begin executed for Guard::RSpec
09:34:36 - INFO - Running: spec/test_spec.rb
09:34:36 - DEBUG - Command execution: {"GUARD_RSPEC_RESULTS_FILE"=>"tmp/rspec_guard_result"} rspec -f progress -r /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec_formatter.rb -f Guard::RSpecFormatter --failure-exit-code 2  spec/test_spec.rb
.

Finished in 0.126 seconds (files took 1.41 seconds to load)
1 example, 0 failures


09:34:39 - DEBUG - Hook :run_on_modifications_end executed for Guard::RSpec
09:34:39 - DEBUG - Guards jobs done. Sleeping...
09:34:50 - DEBUG - Sleep interrupted by events.
09:34:50 - DEBUG - Hook :run_on_modifications_begin executed for Guard::RSpec
09:34:50 - INFO - Running: spec/test_spec.rb
09:34:50 - DEBUG - Command execution: {"GUARD_RSPEC_RESULTS_FILE"=>"tmp/rspec_guard_result"} rspec -f progress -r /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec_formatter.rb -f Guard::RSpecFormatter --failure-exit-code 2  spec/test_spec.rb
.

Finished in 0.126 seconds (files took 1.51 seconds to load)
1 example, 0 failures

09:34:53 - ERROR - Guard::RSpec failed to achieve its <run_on_modifications>, exception was:
> [#] Errno::ECHILD: No child processes - No child processes
> [#] org/jruby/RubyProcess.java:728:in `waitpid2'
> [#] org/jruby/RubyProcess.java:777:in `wait2'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec/rspec_process.rb:39:in `_really_run'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec/rspec_process.rb:28:in `_run'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec/rspec_process.rb:53:in `_without_bundler_env'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/bundler-1.10.3/lib/bundler.rb:245:in `with_clean_env'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/bundler-1.10.3/lib/bundler.rb:232:in `with_original_env'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/bundler-1.10.3/lib/bundler.rb:238:in `with_clean_env'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec/rspec_process.rb:53:in `_without_bundler_env'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec/rspec_process.rb:27:in `_run'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec/rspec_process.rb:16:in `initialize'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec/runner.rb:68:in `_really_run'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec/runner.rb:57:in `_run'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec/runner.rb:41:in `run'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec.rb:42:in `run_on_modifications'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec.rb:48:in `_throw_if_failed'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec.rb:42:in `run_on_modifications'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/bundler/gems/guard-62fc16d38d52/lib/guard/runner.rb:82:in `_supervise'
> [#] org/jruby/RubyKernel.java:1274:in `catch'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/bundler/gems/guard-62fc16d38d52/lib/guard/runner.rb:79:in `_supervise'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/bundler/gems/guard-62fc16d38d52/lib/guard/runner.rb:61:in `run_on_changes'
> [#] org/jruby/RubyHash.java:1341:in `each'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/bundler/gems/guard-62fc16d38d52/lib/guard/runner.rb:56:in `run_on_changes'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/bundler/gems/guard-62fc16d38d52/lib/guard/runner.rb:119:in `_run_group_plugins'
> [#] org/jruby/RubyArray.java:1613:in `each'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/bundler/gems/guard-62fc16d38d52/lib/guard/runner.rb:117:in `_run_group_plugins'
> [#] org/jruby/RubyKernel.java:1274:in `catch'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/bundler/gems/guard-62fc16d38d52/lib/guard/runner.rb:116:in `_run_group_plugins'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/bundler/gems/guard-62fc16d38d52/lib/guard/runner.rb:54:in `run_on_changes'
> [#] org/jruby/RubyArray.java:1613:in `each'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/bundler/gems/guard-62fc16d38d52/lib/guard/runner.rb:53:in `run_on_changes'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/bundler/gems/guard-62fc16d38d52/lib/guard/internals/queue.rb:23:in `process'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/bundler/gems/guard-62fc16d38d52/lib/guard/commander.rb:43:in `start'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/bundler/gems/guard-62fc16d38d52/lib/guard/cli/environments/valid.rb:16:in `start_guard'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/bundler/gems/guard-62fc16d38d52/lib/guard/cli.rb:122:in `start'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/bundler/gems/guard-62fc16d38d52/lib/guard/aruba_adapter.rb:32:in `execute'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/bundler/gems/guard-62fc16d38d52/lib/guard/aruba_adapter.rb:19:in `execute!'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.20.1/lib/ruby/gems/shared/bundler/gems/guard-62fc16d38d52/bin/_guard-core:11:in `(root)'
09:34:53 - INFO - Guard::RSpec has just been fired
09:34:53 - DEBUG - Guards jobs done. Sleeping...

@e2
Copy link
Contributor

e2 commented Aug 22, 2015

Sorry, I didn't notice that RSpec actually succeeded (the "Finished (...)" output).

It seems like it's a JRuby bug: jruby/jruby#3117

You might simply have to pull in a newer JRuby, containing at least this: jruby/jruby@6016c39

@e2 e2 changed the title Problem with guard-rspec on JRuby "Errno::ECHILD: No child processes" on JRuby Aug 22, 2015
@e2
Copy link
Contributor

e2 commented Aug 22, 2015

I updated the title so people can find this. If this occurs more frequently, I'll patch Guard::RSpec to show an error or something.

@jasonrclark
Copy link
Author

Ah, good find. That does appear to be related, but I updated to JRuby 1.7.22 which has that commit in it, and I'm still getting a failure there, although the stack is a bit different:

10:23:05 - ERROR - Guard::RSpec failed to achieve its <run_on_modifications>, exception was:
> [#] Errno::ECHILD: No child processes - No child processes
> [#] org/jruby/RubyProcess.java:536:in `waitpid'
> [#] org/jruby/RubyProcess.java:521:in `waitpid'
> [#] org/jruby/RubyProcess.java:716:in `waitpid2'
> [#] org/jruby/RubyProcess.java:724:in `waitpid2'
> [#] org/jruby/RubyProcess.java:771:in `wait2'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.22/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec/rspec_process.rb:39:in `_really_run'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.22/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec/rspec_process.rb:28:in `_run'
> [#] /Users/jclark/.rbenv/versions/jruby-1.7.22/lib/ruby/gems/shared/gems/guard-rspec-4.6.4/lib/guard/rspec/rspec_process.rb:53:in `_without_bundler_env'

(Full trace in a gist)

Should I bring this up on the JRuby thread you think?

@jasonrclark
Copy link
Author

Much better title by the way. Thanks!

@e2
Copy link
Contributor

e2 commented Aug 22, 2015

I just reported it here: jruby/jruby#3274

I can probably patch this with a call to system - spawn+wait2 aren't really necessary here, they're just a workaround to effectively mock out the command and the return value.

Still, if it's a JRuby bug, it's worth fixing (especially since I can't reproduce it on Linux).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants