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

WEBrick randomly fails with "can't add a new key into hash during iteration" #2844

Open
jmiettinen opened this issue Apr 17, 2015 · 1 comment

Comments

@jmiettinen
Copy link
Contributor

When running different pieces of software (Rails, Jasmine, etc) with JRuby and WEBrick, I get from time to time the following error:

[2015-04-16 23:40:36] ERROR RuntimeError: can't add a new key into hash during iteration
   org/jruby/RubyHash.java:986:in `[]='
   /home/foo/.rbenv/versions/jruby-1.7.12/lib/ruby/1.9/webrick/utils.rb:205:in `register'
   /home/foo/.rbenv/versions/jruby-1.7.12/lib/ruby/1.9/webrick/utils.rb:161:in `register'
   org/jruby/ext/thread/Mutex.java:149:in `synchronize'
   /home/foo/.rbenv/versions/jruby-1.7.12/lib/ruby/1.9/webrick/utils.rb:160:in `register'
   /home/foo/.rbenv/versions/jruby-1.7.12/lib/ruby/1.9/webrick/utils.rb:232:in `timeout'
   /home/foo/.rbenv/versions/jruby-1.7.12/lib/ruby/1.9/webrick/httprequest.rb:398:in `_read_data'
   /home/foo/.rbenv/versions/jruby-1.7.12/lib/ruby/1.9/webrick/httprequest.rb:409:in `read_line'
   /home/foo/.rbenv/versions/jruby-1.7.12/lib/ruby/1.9/webrick/httprequest.rb:316:in `read_header'
   /home/foo/.rbenv/versions/jruby-1.7.12/lib/ruby/1.9/webrick/httprequest.rb:92:in `parse'
   /home/foo/.rbenv/versions/jruby-1.7.12/lib/ruby/1.9/webrick/httpserver.rb:81:in `run'
   /home/foo/.rbenv/versions/jruby-1.7.12/lib/ruby/1.9/webrick/server.rb:191:in `start_thread'

This happens in JRuby 1.7.12 (also seen on earlier versions).
I guess this is more-or-less this issue and that doesn't seem to be fixed at least in master.

@p4ali
Copy link

p4ali commented Oct 28, 2015

Got the smilar error randomly on 1.7.19 version:

[2015-10-28 14:19:52] ERROR RuntimeError: can't add a new key into hash during iteration
    org/jruby/RubyHash.java:991:in `[]='
    /usr/local/rvm/rubies/jruby-1.7.19/lib/ruby/1.9/webrick/utils.rb:205:in `register'
    /usr/local/rvm/rubies/jruby-1.7.19/lib/ruby/1.9/webrick/utils.rb:161:in `register'
    org/jruby/ext/thread/Mutex.java:149:in `synchronize'
    /usr/local/rvm/rubies/jruby-1.7.19/lib/ruby/1.9/webrick/utils.rb:160:in `register'
    /usr/local/rvm/rubies/jruby-1.7.19/lib/ruby/1.9/webrick/utils.rb:232:in `timeout'
    /usr/local/rvm/rubies/jruby-1.7.19/lib/ruby/1.9/webrick/httprequest.rb:399:in `_read_data'
    /usr/local/rvm/rubies/jruby-1.7.19/lib/ruby/1.9/webrick/httprequest.rb:414:in `read_data'
    /usr/local/rvm/rubies/jruby-1.7.19/lib/ruby/1.9/webrick/httprequest.rb:357:in `read_body'
    /usr/local/rvm/rubies/jruby-1.7.19/lib/ruby/1.9/webrick/httprequest.rb:140:in `body'
    /usr/local/rvm/gems/jruby-1.7.19/gems/rack-1.5.2/lib/rack/handler/webrick.rb:38:in `service'
    /usr/local/rvm/rubies/jruby-1.7.19/lib/ruby/1.9/webrick/httpserver.rb:138:in `service'
    /usr/local/rvm/rubies/jruby-1.7.19/lib/ruby/1.9/webrick/httpserver.rb:94:in `run'
    /usr/local/rvm/rubies/jruby-1.7.19/lib/ruby/1.9/webrick/server.rb:191:in `start_thread'

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