hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From swatkatz <mohanrao...@gmail.com>
Subject Re: HttpCore NIO hurt by JDK bug?
Date Mon, 01 Nov 2010 20:25:21 GMT

We are using HttpCore 4.0.1

Also in particular in DefaultConnectingIOReactor -

 SocketChannel socketChannel;
            try {
                socketChannel = SocketChannel.open();
                socketChannel.configureBlocking(false);
            } catch (IOException ex) {
                throw new IOReactorException("Failure opening socket", ex);
            }
            try {
                validateAddress(request.getLocalAddress());
                validateAddress(request.getRemoteAddress());
                
                if (request.getLocalAddress() != null) {
                    socketChannel.socket().bind(request.getLocalAddress());
                }
                boolean connected =
socketChannel.connect(request.getRemoteAddress());
                if (connected) {
                    prepareSocket(socketChannel.socket());
                    ChannelEntry entry = new ChannelEntry(socketChannel,
request); 
                    addChannel(entry);
                    return;
                }
            } catch (IOException ex) {
                request.failed(ex);
                return;
            }


In the above code - should the socketChannel be closed before request.failed
is called ?


olegk wrote:
> 
> On Mon, 2010-11-01 at 13:13 -0700, swatkatz wrote:
>> It looks like we can consistently reproduce this whenever there is a
>> failed
>> connection. There seems to be a file descriptor leak everytime there is a
>> failed connection.
>> 
>> We registered a SessionRequestCallback and each time public void
>> failed(final SessionRequest request) is called we seem to have a file
>> descriptor leak.
>> 
>> Perhaps there is a bug where the descriptor is not cleaned up properly if
>> there is a failure connecting ?
>> 
> 
> I personally think it is not very likely but certainly not impossible.
> Could you please try to put together a small application that could be
> used to reproduce the issue?
> 
> What version of HttpCore are you using?
> 
> Oleg
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/HttpCore-NIO-hurt-by-JDK-bug--tp29155405p30108286.html
Sent from the HttpComponents-Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message