Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8C5DAC084 for ; Fri, 7 Mar 2014 09:27:58 +0000 (UTC) Received: (qmail 56559 invoked by uid 500); 7 Mar 2014 09:27:57 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 55906 invoked by uid 500); 7 Mar 2014 09:27:54 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 54150 invoked by uid 99); 7 Mar 2014 09:27:48 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Mar 2014 09:27:48 +0000 Date: Fri, 7 Mar 2014 09:27:48 +0000 (UTC) From: "Oleg Kalnichevski (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (HTTPCLIENT-1476) Thread lock within httpClient call MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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 registry = RegistryBuilder.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> entry : connectionParams.entrySet()) { > List 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: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org