hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "yair ogen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCLIENT-1583) Code to release expired connections is deprecated
Date Wed, 26 Nov 2014 09:38:12 GMT

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14225955#comment-14225955

yair ogen commented on HTTPCLIENT-1583:

This is a bug report as the API you suggest ti use for releasing expired connections is not
accessible without the deprecated API.
Again - I am not creating a reference to the connection manager as the one created by default
in the builder is excellent for me. 
So - in this valid usage I have no reference to the connection manager other than the deprecated

> Code to release expired connections is deprecated
> -------------------------------------------------
>                 Key: HTTPCLIENT-1583
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1583
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: 4.3.5
>            Reporter: yair ogen
> In the tutorial:
> http://hc.apache.org/httpcomponents-client-ga/tutorial/html/connmgmt.html, section 2.5
Connection eviction policy - you explain how to clean-up connections. Although I can argue
against the design as without this if server closes connections, my client gets many sockets
stuck on CLOSE_WAIT - adding this thread solves the CLOSE_WAIT issue. 
> However, I don't understand why you don't do this yourself if keep-alive is set. I would
expect the library to support such a thread. In the meanwhile, it seems that if I use the
default connection manager, I can't use non-deprecated code to call :
> connMgr.closeExpiredConnections();
> and
> connMgr.closeIdleConnections(30, TimeUnit.SECONDS);
> This is because the only exposed API to get the default pooling connection manager is
by calling:
> httpClient.getConnectionManager(), which is deprecated. Javadoc suggests to go to the
builder (which I do use but not for creating connection pool as the default is good enough
for me) which is useless.
> So - how should one acquire a reference to the connection manager?

This message was sent by Atlassian JIRA

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

View raw message