Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.1.5
-
Fix Version/s: JRuby 1.2
-
Component/s: Core Classes/Modules
-
Labels:None
-
Environment:Microsoft Windows XP Professional SP3, JDK1.6.0_07, JRuby 1.1.5
Description
As already mentioned here (http://jira.codehaus.org/browse/JRUBY-2148), JRuby is not working correctly when using timeouts, whereas the original Ruby Interpreter is doing the job in the cases I tested. It would be very nice to somehow fix this bug, as other classes such as Net::Http are also affected by JRuby's erratic behaviour. In my example an Http-request to a slow responding server only throws the Timeout::Error after a response from the server is received, as Timeout's "Killer-Thread" is blocked by the main thread waiting for the server's response. A demonstrating script is attached. For executing the script, a server is required, that waits some seconds before sending the response (e.g. easy RoR app with sleep(10) in the index method).
This particular case appears to work well now. We have made modifications over the past several months that should make most IO operations interruptible, which allows timeout to fire. If you see additional cases failing please file bugs.