Timeouts don't work correctly for https sessions
------------------------------------------------
Key: JRUBY-5059
URL: http://jira.codehaus.org/browse/JRUBY-5059
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.5.2
Environment: Mac and Ubuntu
Reporter: Brad Pardee
Attachments: test_net_http.rb
We had an outside supplier go down which resulted in our Net::HTTP connections
to them locking up for several minutes. We had these connections wrapped up in
a timeout block which seemed to not correctly timeout after the requested time.
This resulted in all of our glassfish connections that were handling requests
to become locked up as well which basically brought our site down.
I wrote the attached test program to figure out exactly what was going on. You
will need to create a dummy cert and key to use it. Here's how I did it:
openssl genrsa 1024 > host.key
chmod 400 host.key
openssl req -new -x509 -nodes -sha1 -days 365 -key host.key > host.cert
When run with an http connection, the tests worked as expected. open_timeout
seemed to be completely ignored for both MRI and JRuby but maybe I
misunderstand what its supposed to do.
When run with an https connection under JRuby, read_timeout and Timeout blocks
don't actually timeout until after the read is complete. This means that even
if you wrap your request in a Timeout.timeout(3) block, if the connection takes
5 minutes then thats how long it will take for your Timeout error to get
raised. This works as expected under MRI.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email