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

Difference in exception handling behavior JRuby <-> Ruby 1.9.3 #846

Closed
rb2k opened this Issue Jul 2, 2013 · 9 comments

Comments

Projects
None yet
7 participants
@rb2k
Copy link

commented Jul 2, 2013

I noticed some strange behavioral differences with the PageRankr gem ( blatyo/page_rankr#29 ) and @headius tweeted that I should probably open a jruby bug report.

Here's the copypasta:

$ irb
1.9.3p429 :001 > require 'page_rankr'
 => true 
1.9.3p429 :002 > PageRankr.ranks('something.com', :alexa_global)
 => {:alexa_global=>508145} 
1.9.3p429 :003 > PageRankr.ranks('something.com', :alexa_global)
 => {:alexa_global=>nil} 
1.9.3p429 :004 > PageRankr.ranks('something.com', :alexa_global)
 => {:alexa_global=>nil} 
1.9.3p429 :005 > PageRankr.ranks('something.com', :alexa_global)
 => {:alexa_global=>508145} 
1.9.3p429 :006 > PageRankr.ranks('something.com', :alexa_global)
 => {:alexa_global=>nil} 
1.9.3p429 :007 > PageRankr.ranks('something.com', :alexa_global)
 => {:alexa_global=>nil} 
1.9.3p429 :008 > PageRankr.ranks('something.com', :alexa_global)
 => {:alexa_global=>nil} 
1.9.3p429 :009 > PageRankr.ranks('something.com', :alexa_global)
 => {:alexa_global=>nil} 
1.9.3p429 :010 > PageRankr.ranks('something.com', :alexa_global)
 => {:alexa_global=>nil} 
1.9.3p429 :011 > exit

And with JRuby

msmbp:~ mseeger$ irb
jruby-1.7.4 :001 > require 'page_rankr'
 => true 
jruby-1.7.4 :002 > PageRankr.ranks('something.com', :alexa_global)
 => {:alexa_global=>508145} 
jruby-1.7.4 :003 > PageRankr.ranks('something.com', :alexa_global)
 => {:alexa_global=>508145} 
jruby-1.7.4 :004 > PageRankr.ranks('something.com', :alexa_global)
EOFError: End of file reached
    from org/jruby/RubyIO.java:2671:in `read_nonblock'
    from /Users/mseeger/.rvm/rubies/jruby-1.7.4/lib/ruby/1.9/net/protocol.rb:141:in `rbuf_fill'
    from /Users/mseeger/.rvm/rubies/jruby-1.7.4/lib/ruby/1.9/net/protocol.rb:122:in `readuntil'
    from /Users/mseeger/.rvm/rubies/jruby-1.7.4/lib/ruby/1.9/net/protocol.rb:132:in `readline'
    from /Users/mseeger/.rvm/rubies/jruby-1.7.4/lib/ruby/1.9/net/http.rb:2570:in `read_status_line'
    from /Users/mseeger/.rvm/rubies/jruby-1.7.4/lib/ruby/1.9/net/http.rb:2559:in `read_new'
    from /Users/mseeger/.rvm/rubies/jruby-1.7.4/lib/ruby/1.9/net/http.rb:1327:in `transport_request'
    from org/jruby/RubyKernel.java:1254:in `catch'
    from /Users/mseeger/.rvm/rubies/jruby-1.7.4/lib/ruby/1.9/net/http.rb:1324:in `transport_request'
    from /Users/mseeger/.rvm/rubies/jruby-1.7.4/lib/ruby/1.9/net/http.rb:1301:in `request'
    from /Users/mseeger/.rvm/rubies/jruby-1.7.4/lib/ruby/1.9/net/http.rb:1294:in `request'
    from /Users/mseeger/.rvm/rubies/jruby-1.7.4/lib/ruby/1.9/net/http.rb:745:in `start'
    from /Users/mseeger/.rvm/rubies/jruby-1.7.4/lib/ruby/1.9/net/http.rb:1292:in `request'
    from /Users/mseeger/.rvm/gems/jruby-1.7.4/gems/httparty-0.11.0/lib/httparty/request.rb:92:in `perform'
    from /Users/mseeger/.rvm/gems/jruby-1.7.4/gems/httparty-0.11.0/lib/httparty.rb:461:in `perform_request'
    from /Users/mseeger/.rvm/gems/jruby-1.7.4/gems/httparty-0.11.0/lib/httparty.rb:398:in `get'
    from /Users/mseeger/.rvm/gems/jruby-1.7.4/gems/httparty-0.11.0/lib/httparty.rb:493:in `get'
    from org/jruby/RubyBasicObject.java:1715:in `__send__'
    from org/jruby/RubyKernel.java:2217:in `send'
    from /Users/mseeger/.rvm/gems/jruby-1.7.4/gems/PageRankr-4.1.1/lib/page_rankr/request.rb:14:in `perform'
    from /Users/mseeger/.rvm/gems/jruby-1.7.4/gems/PageRankr-4.1.1/lib/page_rankr/tracker.rb:43:in `run'
    from /Users/mseeger/.rvm/gems/jruby-1.7.4/gems/PageRankr-4.1.1/lib/page_rankr/trackers.rb:36:in `build_thread'jruby-1.7.4 :005 > 

I haven't found any specific piece of code I suspect, but I would guess something with the gems internal use of threading.

@bethesque

This comment has been minimized.

Copy link

commented Dec 14, 2014

I've been getting EOFError intermittently with only my jruby builds on Travis CI, never MRI. I cannot reproduce, as it is so intermittent. Nothing to do with alexa, but any ideas?
https://travis-ci.org/realestate-com-au/pact/jobs/43982235

@fcruxen

This comment has been minimized.

Copy link

commented Jan 12, 2015

+1 on this

I am getting the exact same error using jruby 1.7.x (tried .12, .16, .18) using chromedriver in selenium. It fails in the same method (rbuf_fill) in /net/protocol.rb. I can check on the issues this was patched in 1.7.12, but I still get this error using this version. the error does not occur in ruby MRI.

EOFError: End of file reached
from org/jruby/RubyIO.java:2856:in read_nonblock' from /opt/jruby-1.7.12/lib/ruby/1.9/net/protocol.rb:141:inrbuf_fill'
from /opt/jruby-1.7.12/lib/ruby/1.9/net/protocol.rb:122:in readuntil' from /opt/jruby-1.7.12/lib/ruby/1.9/net/protocol.rb:132:inreadline'
from /opt/jruby-1.7.12/lib/ruby/1.9/net/http.rb:2570:in read_status_line' from /opt/jruby-1.7.12/lib/ruby/1.9/net/http.rb:2559:inread_new'
from /opt/jruby-1.7.12/lib/ruby/1.9/net/http.rb:1327:in transport_request' from org/jruby/RubyKernel.java:1264:incatch'
from /opt/jruby-1.7.12/lib/ruby/1.9/net/http.rb:1324:in transport_request' from /opt/jruby-1.7.12/lib/ruby/1.9/net/http.rb:1301:inrequest'
from /opt/jruby-1.7.12/lib/ruby/1.9/net/http.rb:1294:in request' from /opt/jruby-1.7.12/lib/ruby/1.9/net/http.rb:745:instart'
from /opt/jruby-1.7.12/lib/ruby/1.9/net/http.rb:1292:in request' from /opt/jruby-1.7.12/lib/ruby/gems/shared/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/default.rb:83:inresponse_for'
from /opt/jruby-1.7.12/lib/ruby/gems/shared/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/default.rb:39:in request' from /opt/jruby-1.7.12/lib/ruby/gems/shared/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/common.rb:40:incall'
from /opt/jruby-1.7.12/lib/ruby/gems/shared/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/bridge.rb:640:in raw_execute' from /opt/jruby-1.7.12/lib/ruby/gems/shared/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/bridge.rb:101:increate_session'
from /opt/jruby-1.7.12/lib/ruby/gems/shared/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/bridge.rb:68:in initialize' from /opt/jruby-1.7.12/lib/ruby/gems/shared/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/chrome/bridge.rb:29:ininitialize'
from /opt/jruby-1.7.12/lib/ruby/gems/shared/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/common/driver.rb:37:in for' from /opt/jruby-1.7.12/lib/ruby/gems/shared/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver.rb:67:infor'
from /opt/jruby-1.7.12/lib/ruby/gems/shared/gems/watir-webdriver-0.6.11/lib/watir-webdriver/browser.rb:46:in initialize' from (irb):5:inevaluate'
from org/jruby/RubyKernel.java:1101:in eval' from org/jruby/RubyKernel.java:1501:inloop'
from org/jruby/RubyKernel.java:1264:in catch' from org/jruby/RubyKernel.java:1264:incatch'

@headius

This comment has been minimized.

Copy link
Member

commented Jan 26, 2015

This may be fixed in JRuby 9k, since it has a mostly-complete re-port of MRI's IO logic. Can someone test there?

If this is still broken in 1.7.18, I'd like to know that too...with as small a reproduction as possible.

@headius headius added the JRuby 1.7.x label Jan 26, 2015

@headius

This comment has been minimized.

Copy link
Member

commented Jan 26, 2015

Oh, I see from @fcruxen that it does fail on 1.7.18.

@fcruxen

This comment has been minimized.

Copy link

commented Jan 26, 2015

@headius, onde piece of information, os was centos, tried ubuntu and it worked. Ssl lib version and location are the only difference comparing scenarios to jruby. Hope it helps, thanks in advance.

@rb2k

This comment has been minimized.

Copy link
Author

commented Jan 26, 2015

(mine failed on ubuntu)

@headius

This comment has been minimized.

Copy link
Member

commented Jan 27, 2015

I could not reproduce on OS X in JRuby 9k, so that's something.

@rtyler

This comment has been minimized.

Copy link

commented Aug 2, 2015

I have tested this on Debian with JRuby 1.7.21 and the issue appears to be fixed:

jruby-1.7.21 :001 > require 'page_rankr'
 => true 
jruby-1.7.21 :002 > PageRankr.ranks('something.com', :alexa_global)
 => {:alexa_global=>983535} 
# snipped a typo
jruby-1.7.21 :006 > PageRankr.ranks('something.com', :alexa_global)
 => {:alexa_global=>983535} 
jruby-1.7.21 :007 > PageRankr.ranks('something.com', :alexa_global)
 => {:alexa_global=>983535} 
jruby-1.7.21 :008 > PageRankr.ranks('something.com', :alexa_global)
 => {:alexa_global=>983535} 
jruby-1.7.21 :009 > PageRankr.ranks('something.com', :alexa_global)
 => {:alexa_global=>983535} 
jruby-1.7.21 :010 > 

@rb2k if you see that this is fixed, pleas close it

@kares

This comment has been minimized.

Copy link
Member

commented Nov 14, 2015

assuming fixed

@kares kares closed this Nov 14, 2015

@enebo enebo added this to the JRuby 1.7.23 milestone Nov 24, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.