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
RethinkDB::Binary causes hang on jRuby #3795
Comments
This was also against server version 1.15.2~0trusty |
@mlucy can you take a look at this? |
@danielmewes -- will do. |
https://gist.github.com/jhstatewide/df4842f63efb20d7eb3e Here is a stack trace from the hanging program. I generated this with "jstack", hopefully it is of some use. |
@jhstatewide -- does this happen every time? |
@mlucy, yes, 100% reproducible with this script |
Alright, planning to work on this next once my current changes are in. It's probably a result of JRuby having real threads and us not testing the multithreaded part of our driver in anything except CRuby. @larkost -- once this is fixed, would it be possible to add JRuby to the list of Ruby versions we test with? |
I have further information... I generated random strings at increasing lengths... the following script works fine until the document reaches ~60k bytes... https://gist.github.com/jhstatewide/70ea290678ac2eda4ce1 It also works great on MRI... 200k+ and counting |
Haven't investigated it, but it could be the query is filling up the TCP send buffer which the driver may not be handling correctly. |
If this is the problem, it may be that changing the |
@Tryneus sendmsg is not implemented on JRuby but I can confirm that the hang is on that @socket.write |
I reproduced this on newton using JRuby 1.17.19, and it appears that the This would likely correspond to this area of the stack trace from @jhstatewide:
Perhaps the JRuby |
I wouldn't recommend using this as the solution, but on newton, changing the |
Ok, my last comment was a little misleading as I hadn't had a chance to fully test it. At this point, I'm willing to accept this as a solution (up in code review 2630). The new def send packet
written = 0
while written < packet.length
written += @socket.syswrite(packet.slice(written, packet.length))
end
end It seems that JRuby's Tested with extremely large rows, resulting in many partial writes on JRuby, everything seems to be in working order. Tested with JRuby 1.7.19 (built from source) and Ruby 2.0.0. |
@Tryneus: I can confirm your findings. Both of my test cases now pass with your updates to net.rb. Thanks very much for the fast response! |
👍 |
Fix has been approved and merged to Thanks for reporting this, @jhstatewide, glad we could get to the root of it! |
@AtnNn Can we push out an update of just the Ruby driver? |
I'll do that now. |
The new version of the ruby driver, 1.16.0.1, has ben released and includes this fix. |
Cool, thank you @AtnNn |
The following script causes a client hang on JRuby:
https://gist.github.com/jhstatewide/e214d9d567b82f0d29ef
jruby 1.7.13 (1.9.3p392) 2014-06-24 43f133c on Java HotSpot(TM) 64-Bit Server VM 1.8.0_25-b17 [linux-amd64]
works fine on MRI 1.9.1
The text was updated successfully, but these errors were encountered: