|
Wow, this is a really good find. I don't see why this wouldn't be correct yet. Marking for JRuby 1.1.1 (possibly could sneak this into 1.1 though).
I'd suggest it for 1.1. If 2 people have already experienced it in RC3 its bound to be a problem for many people who use JRuby with web apps. I have a release in a week, do you think I am safe enough deploying with Milton's patch and RC3? Or should I stay on RC1? Thanks a lot for all your great work.
Better link to thread describing what I saw with this issue: http://www.nabble.com/JRuby-1.1RC3---Goldspike-1.6-Fedora-6-problem-td16232224.html
Moving to 1.1. This is critical enough to promote it now, so we'll merge the fix to 1.1 tomorrow and push it out with the 1.1 release this weekend. Additional testing after promotion to a temporary 1.1 branch would be extremely welcome.
I'll be happy to test ASAP when you are ready. I'll make it my first priority. Like I said, we release our R1 of our app Monday and I'd love to be on 1.1.
Solves other issues? http://www.nabble.com/Drb-problem-%3A-related-with-sended-data-size--to16327190.html
I think the correct change for this is not to remove the == check entirely, but to change it to break out of the loop of read == 0. In a case where we have nonblocking IO and there's nothing available to read, it's certainly possible that a read might return no bytes. If we remove the check completely, the bufferedRead loop would run forever or until the stream had available data...defeating nonblocking behavior.
I'll tidy up a patch, apply it to 1.1, and post it here for any remaining discussion. Ok, here's the patch:
The idea here is that the read loop will keep reading as long as it reads more than zero bytes. If it reads zero bytes the loop terminates and it returns what it got. If the read returns -1 for EOF, it set the EOF flag and returns what it got, raising an error if it's both EOF and nothing was read. This should fix the original issue, where it would give up too early reading from a stream that had more available, but also allow nonblocking reads to safely return zero bytes for a given loop without running forever. Tests pass on my end, things are looking ok. Comments before we push this out? I'll apply the patch to RC3 and test shortly.
Actually, Mike, Charlie has just created a jruby-1_1 branch, and all the critical fixes are there.
So it would probably make sense to try that branch. Forgot to add, that there were a bit more changes on top of that patch listed above.
Glad I mentioned it! Ok, I'll grab the branch and test within the hour. Are the other changes listed somewhere? Thanks. This is likely what we'll be releasing with. Timing splendid
Fixed on trunk and on the temporary 1.1 branch. This will be in the 1.1 release.
All the changes in 1.1 branch can be seen here:
http://svn.jruby.codehaus.org/changelog/jruby/branches/jruby-1_1 Thanks. Worked locally, committing the new .jar to our SVN repo now, Hudson CI will take it from there. Will let you know how it goes.
Works. Thanks so much for getting this in. As we emerge from the panic of our first release, we'll pay you back with more contributions to the JRuby community.
Cheers, Mike |
|||||||||||||||||||||||||||||||||||||||||||||||||
http://archive.jruby.codehaus.org/user/47E5A81A.60100%40csinitiative.com
for details
(the archive seems way behind btw)