Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6, JRuby 1.6.6
-
Fix Version/s: JRuby 1.6.8, JRuby 1.7.0.pre1
-
Component/s: Core Classes/Modules
-
Labels:None
-
Environment:jruby 1.6.7
-
Number of attachments :
Description
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
Issue Links
- is duplicated by
-
JRUBY-6607
TCPSocket connect failure inside Timeout leaves orphaned sockets
-
FYI cruby 1.8.7 works correctly and does not leave an open connection.