Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6
-
Fix Version/s: JRuby 1.6.1
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
This ruby code appears to be leaking a native java exception?
def self.open(host, port, options = {})
# All this ugly code to ensure proper Socket connect timeout
addr = Socket.getaddrinfo(host, nil)
sock = new(Socket.const_get(addr[0][0]), Socket::SOCK_STREAM, 0)
sock.options = { :host => host, :port => port }.merge(options)
begin
sock.connect_nonblock(Socket.pack_sockaddr_in(port, addr[0][3]))
rescue Errno::EINPROGRESS
resp = IO.select(nil, [sock], nil, options[:timeout])
begin
sock.connect_nonblock(Socket.pack_sockaddr_in(port, addr[0][3]))
rescue Errno::EISCONN
end
end
sock
end
java.nio.channels.ConnectionPendingException at sun.nio.ch.SocketChannelImpl.ensureOpenAndUnconnected(SocketChannelImpl.java:469) at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:479) at org.jruby.ext.socket.RubySocket.connect(RubySocket.java:388) at org.jruby.ext.socket.RubySocket.connect_nonblock(RubySocket.java:353) at org.jruby.ext.socket.RubySocket$i$1$0$connect_nonblock.call(RubySocket$i$1$0$connect_nonblock.gen:65535) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:137) at rubyjit.open_9FF8DD58E409A6A12D778FF27EEFA8B7D8A04FF8.chained_2_rescue_2$RUBY$SYNTHETIC__file__(/Users/mperham/src/git/dalli/lib/dalli/socket.rb:66) at rubyjit.open_9FF8DD58E409A6A12D778FF27EEFA8B7D8A04FF8.chained_1_rescue_line_62(/Users/mperham/src/git/dalli/lib/dalli/socket.rb:65)
I guess I need formatting help.