Chris Ochs created JRUBY-6498: --------------------------------- Summary: Net::Http does not close socket when open_timeout is exceeded Key: JRUBY-6498 URL: https://jira.codehaus.org/browse/JRUBY-6498 Project: JRuby Issue Type: Bug Components: Core Classes/Modules Affects Versions: JRuby 1.6.6, JRuby 1.6 Environment: jruby 1.6.7 Reporter: Chris Ochs
When open_timeout is exceeded the connection is still established even though it throws Timeout::Error, and the socket is left open. The following code will leave an established connection that you can see in netstat. Trying to call finish throws an IO error. begin puts 'STARTING CONNECTION' @conn = Net::HTTP.new("www.google.com",80) @conn.open_timeout = 0.001 @conn.start rescue Timeout::Error => e puts 'CONNECTION TIMEOUT' #@conn.finish puts "CONNECTION FINISHED" end sleep 1000 -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.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