[
https://issues.apache.org/jira/browse/HTTPCLIENT-1476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Oleg Kalnichevski resolved HTTPCLIENT-1476.
-------------------------------------------
Resolution: Invalid
Please post your questions to the httpclient user list [1].
As far as this problem is concerned I think your application very likely leaks
connections (by failing to always close response objects), depletes the
connection pool and causes all subsequent requests to blocking waiting for a
free connection.
Oleg
[1] http://hc.apache.org/mail.html
> Thread lock within httpClient call
> ----------------------------------
>
> Key: HTTPCLIENT-1476
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1476
> Project: HttpComponents HttpClient
> Issue Type: Test
> Components: HttpClient
> Affects Versions: 4.3 Final
> Environment: Linux, Virtual machine
> Reporter: Gazolinia
> Labels: newbie
> Fix For: 4.3 Final
>
>
> We have a multi threaded application which makes call to many http server. To
> make this http connection we are using HttpClient code with Pooling
> connectionManager. Recently we identified that all the threads in our
> application got stuck within the HttpClient code execution (Will paste/upload
> the thread dump soon.) as a result our application stopped running. Please
> let us know if this is not the right forum for this question.
> 1) Our code snippet is as follows.
> HttpClient httpClient;
>
> Registry<ConnectionSocketFactory> registry =
> RegistryBuilder.<ConnectionSocketFactory>create()
> .register(HTTP_PROTOCOL,
> PlainConnectionSocketFactory.getSocketFactory())
> .register(HTTPS_PROTOCOL,
> SSLConnectionSocketFactory.getSocketFactory()).build();
> PoolingHttpClientConnectionManager cm = new
> PoolingHttpClientConnectionManager(registry);
> cm.setDefaultMaxPerRoute(10);
> cm.setMaxTotal(10);
> if (connectionParams != null && !connectionParams.isEmpty()) {
> for (Map.Entry<String, List<String>> entry :
> connectionParams.entrySet()) {
> List<String> attributes = entry.getValue();
> boolean isSecure = false;
> if (HTTPS_PROTOCOL.equals(attributes.get(0))) {
> isSecure = true;
> }
> HttpRoute route = new HttpRoute(new HttpHost(entry.getKey()),
> null, isSecure);
> cm.setMaxPerRoute(route, 10);
> }
> }
> httpClient = HttpClientBuilder.create().setConnectionManager(cm);
> HttpGet request = new HttpGet("some uri");
> request.setConfig(setConnectionTimeout(1000));
> HttpResponse response = mHTTPClient.execute(request, new
> BasicHttpContext());
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]