hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Am I doing this right: PoolingHttpClientConnectionManager
Date Mon, 12 Oct 2015 07:47:03 GMT
On Sun, 2015-10-11 at 15:13 -0700, Vic Cekvenich wrote:
> Hi Oleg, Thx.
> Is there a way to manually mark a connection as 'stale' or anything such
> 

Closing partially consumed response or aborting the request causes
termination of the underlying connection and its eviction from the
connection pool.

Oleg 

> This would force use of another connection in the pool or establishing a
> new one.
> Vic
> 
> 
> On Sun, Oct 11, 2015 at 1:46 AM, Oleg Kalnichevski <olegk@apache.org> wrote:
> 
> > On Sat, 2015-10-10 at 17:21 -0700, Vic Cekvenich wrote:
> > > Hi, we have heavy load, am I using the pool right:
> > >
> > > 1. I make a call using a client and in finally I consume but * don't *
> > call
> > > close() - since I want conn returned to the pool.
> > >
> >
> > You really _should_ close the response from a try-finally or
> > try-with-resources
> >
> > > 2. In HttpRequestRetryHandler retryRequest, once it retries 10 times, I
> > do
> > > close the conn - since it should be removed from the pool as likely bad.
> > >
> >
> > HttpClient automatically closes and evicts faulty connections.
> >
> > > HttpClientContext ctx = (HttpClientContext) context;
> > > HttpClientConnection conn = (HttpClientConnection) ctx.getConnection();
> > > conn.close();
> > > This I do since I get many close max tries errors and other error
> > responses
> > > from the end point
> > >
> > > I get socket closed errors.
> > >
> > > What should I do in retryRequest after 20 errors to reduce further
> > errors?
> > >
> >
> > Return false.
> >
> > Oleg
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> > For additional commands, e-mail: httpclient-users-help@hc.apache.org
> >
> >



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


Mime
View raw message