Errno::ESRCH at / when trying to use the Rack::Reloader on Windows #391

Closed
perlun opened this Issue May 17, 2012 · 0 comments

2 participants

@perlun

Hi,

Using JRuby 1.6.7 on 64-bit Java 1.7.0_02 on Windows, I'm getting exceptions when trying to use the Rack::Reloader. This is my config.ru:

require 'rubygems'
require 'sinatra'
require 'rack/reloader'
require 'app'

set :environment, :development

use Rack::Reloader, 0 if development?
run Sinatra::Application

And my app.rb:

# app.rb  
Sinatra::Application.reset! 
get '/' do
  'foo'
end

This is the exception I'm seeing. Mizuno had a similar issue before (matadon/mizuno#25) which was recently fixed. Rack::Reloader would probably have to be patched in a similar manner.

Errno::ESRCH at /
No such process - c:/jruby-1.6.7/lib/ruby/site_ruby/1.9/thread.jar
Ruby    org/jruby/RubyFile.java: in stat, line 1539
Web     GET localhost/

Traceback (innermost first)

    org/jruby/RubyFile.java: in stat
    c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/reloader.rb: in safe_stat
        stat = ::File.stat(file)...
    c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/reloader.rb: in figure_path
        found, stat = safe_stat(path)...
    org/jruby/RubyEnumerable.java: in find
    c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/reloader.rb: in figure_path
        paths.find do |possible_path|...
    c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/reloader.rb: in rotation
        found, stat = figure_path(file, paths)...
    org/jruby/RubyArray.java: in collect
    c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/reloader.rb: in rotation
        files.map{|file|...
    c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/reloader.rb: in reload!
        rotation do |file, mtime|...
    c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/reloader.rb: in call
        Thread.exclusive{ reload! }...
    builtin/prelude.rb: in exclusive
    builtin/prelude.rb: in exclusive
    c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/reloader.rb: in call
        Thread.exclusive{ reload! }...
    c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/lint.rb: in _call
        status, headers, @body = @app.call(env)...
    c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/lint.rb: in call
        dup._call(env)...
    c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/showexceptions.rb: in call
        @app.call(env)...
    c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/commonlogger.rb: in call
        status, header, body = @app.call(env)...
    C:/Work/git/mizuno/lib/mizuno/rack/chunked.rb: in call
        @app.call(env)...
    c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/content_length.rb: in call
        status, headers, body = @app.call(env)...
    C:/Work/git/mizuno/lib/mizuno/rack_servlet.rb: in service
        rack_response = @app.call(env)...
    org/jruby/RubyKernel.java: in catch
    C:/Work/git/mizuno/lib/mizuno/rack_servlet.rb: in service
        catch(:async) do...
    C:/Work/git/mizuno/lib/mizuno/rack_servlet.rb: in handle_exceptions
        yield...
    C:/Work/git/mizuno/lib/mizuno/rack_servlet.rb: in service
        handle_exceptions(response) do...

Mizuno's maintainer (matadon) wrote this after he had implemented a fix:

It looks like JRuby throws a different exception on Windows than it does on Unix for a failed stat.

Please, check if you could do a similar fix here. It would be really nice to be able to use Rack::Reloader sometimes...

@rkh rkh closed this in 388990b Oct 25, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment