You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Gordon Ross <gr...@uis.cam.ac.uk> on 2016/04/26 13:27:46 UTC

Pooling Connection Manager Issue

I’m using HTTP Client 4.3.5 with Java 1.7 on Ubuntu Linux.

I’m having problems where the pooling connection manager suddenly claims to have no routes to a host.

Usually, in my logs I see:

2016-04-26 11:13:08,588 [TP-Processor5] DEBUG conn.PoolingHttpClientConnectionManager - Connection request: [route: {}->http://example.com:80][total kept alive: 1; route allocated: 1 of 50; total allocated: 1 of 200]
2016-04-26 11:13:08,588 [TP-Processor5] DEBUG conn.PoolingHttpClientConnectionManager - Connection leased: [id: 1][route: {}->http://example.com:80][total kept alive: 0; route allocated: 1 of 50; total allocated: 1 of 200]
2016-04-26 11:13:08,588 [TP-Processor5] DEBUG conn.DefaultManagedHttpClientConnection - http-outgoing-1: Close connection

But occasionally, I see:

2016-04-26 10:54:05,287 [TP-Processor3] DEBUG conn.PoolingHttpClientConnectionManager - Connection request: [route: {}->http://example.com:80][total kept alive: 0; route allocated: 50 of 50; total allocated: 50 of 200]

i.e. suddenly the routes allocated has jumped from 1 of 50 to 50 of 50.

What’s going on? If I had some form of leak, surely I’d see the routes allocated slowly increasing? (2 of 50, 3 of 50, etc..)

In my application, I’m closing the HttpResponse InputStream to indicate I’ve finished with the connection. Should I be doing anything else/more?

Thanks,

GTG
-- 
Gordon Ross,
UIS Telecoms Office,
University of Cambridge


Re: Pooling Connection Manager Issue

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Tue, 2016-04-26 at 15:37 +0000, Gordon Ross wrote:
> > On 26 Apr 2016, at 15:55, Oleg Kalnichevski <ol...@apache.org> wrote:
> > 
> > Could you please make the entire log available?
> 
> What logs do you want? Currently, I’ve got set:
> 
> Error: org.apache.http.wire
> Debug: org.apache.http.impl.conn, org.apache.http.impl.client, org.apache.http.client
> 
> Would you want any more?
> 

All but org.apache.http.wire

Oleg


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


Re: Pooling Connection Manager Issue

Posted by Gordon Ross <gr...@uis.cam.ac.uk>.
> On 26 Apr 2016, at 15:55, Oleg Kalnichevski <ol...@apache.org> wrote:
> 
> Could you please make the entire log available?

What logs do you want? Currently, I’ve got set:

Error: org.apache.http.wire
Debug: org.apache.http.impl.conn, org.apache.http.impl.client, org.apache.http.client

Would you want any more?

GTG
-- 
Gordon Ross,
UIS Telecoms Office,
University of Cambridge


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


Re: Pooling Connection Manager Issue

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Tue, 2016-04-26 at 11:27 +0000, Gordon Ross wrote:
> I’m using HTTP Client 4.3.5 with Java 1.7 on Ubuntu Linux.
> 
> I’m having problems where the pooling connection manager suddenly claims to have no routes to a host.
> 
> Usually, in my logs I see:
> 
> 2016-04-26 11:13:08,588 [TP-Processor5] DEBUG conn.PoolingHttpClientConnectionManager - Connection request: [route: {}->http://example.com:80][total kept alive: 1; route allocated: 1 of 50; total allocated: 1 of 200]
> 2016-04-26 11:13:08,588 [TP-Processor5] DEBUG conn.PoolingHttpClientConnectionManager - Connection leased: [id: 1][route: {}->http://example.com:80][total kept alive: 0; route allocated: 1 of 50; total allocated: 1 of 200]
> 2016-04-26 11:13:08,588 [TP-Processor5] DEBUG conn.DefaultManagedHttpClientConnection - http-outgoing-1: Close connection
> 
> But occasionally, I see:
> 
> 2016-04-26 10:54:05,287 [TP-Processor3] DEBUG conn.PoolingHttpClientConnectionManager - Connection request: [route: {}->http://example.com:80][total kept alive: 0; route allocated: 50 of 50; total allocated: 50 of 200]
> 
> i.e. suddenly the routes allocated has jumped from 1 of 50 to 50 of 50.
> 
> What’s going on? If I had some form of leak, surely I’d see the routes allocated slowly increasing? (2 of 50, 3 of 50, etc..)
> 
> In my application, I’m closing the HttpResponse InputStream to indicate I’ve finished with the connection. Should I be doing anything else/more?
> 

No, you should not. 

Could you please make the entire log available?

Oleg


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