Return-Path: X-Original-To: apmail-hc-httpclient-users-archive@www.apache.org Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9E9CC11D71 for ; Tue, 16 Sep 2014 19:50:18 +0000 (UTC) Received: (qmail 4680 invoked by uid 500); 16 Sep 2014 19:50:18 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 4628 invoked by uid 500); 16 Sep 2014 19:50:18 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 4617 invoked by uid 99); 16 Sep 2014 19:50:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2014 19:50:17 +0000 X-ASF-Spam-Status: No, hits=-2.8 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_HI,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lainhart@us.ibm.com designates 32.97.182.139 as permitted sender) Received: from [32.97.182.139] (HELO e9.ny.us.ibm.com) (32.97.182.139) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2014 19:49:48 +0000 Received: from /spool/local by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 16 Sep 2014 15:49:46 -0400 Received: from d01dlp02.pok.ibm.com (9.56.250.167) by e9.ny.us.ibm.com (192.168.1.109) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 16 Sep 2014 15:49:45 -0400 Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id F106F6E8029 for ; Tue, 16 Sep 2014 15:49:32 -0400 (EDT) Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s8GJnjHj000294 for ; Tue, 16 Sep 2014 19:49:45 GMT Received: from d01av04.pok.ibm.com (localhost [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s8GJni1A032743 for ; Tue, 16 Sep 2014 15:49:44 -0400 Received: from d01ml255.pok.ibm.com (d01ml255.pok.ibm.com [9.63.10.54]) by d01av04.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s8GJnikF032734 for ; Tue, 16 Sep 2014 15:49:44 -0400 In-Reply-To: <541889B0.8020708@apache.org> References: <1410856202.17023.14.camel@ubuntu> <541889B0.8020708@apache.org> To: "HttpClient User Discussion" MIME-Version: 1.0 Subject: Re: PoolingHttpClientConnectionManager and CloseableHttpResponse X-KeepSent: 3B9870EC:C87B93F8-85257D55:006AE625; type=4; name=$KeepSent X-Mailer: IBM Notes Release 9.0.1SHF211 December 19, 2013 Message-ID: From: Todd W Lainhart Date: Tue, 16 Sep 2014 15:49:44 -0400 X-MIMETrack: Serialize by Router on D01ML255/01/M/IBM(Release 9.0.1FP1|April 03, 2014) at 09/16/2014 15:49:44, Serialize complete at 09/16/2014 15:49:44 Content-Type: multipart/alternative; boundary="=_alternative 006CEC6B85257D55_=" X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14091619-7182-0000-0000-000000777A11 X-Virus-Checked: Checked by ClamAV on apache.org --=_alternative 006CEC6B85257D55_= Content-Type: text/plain; charset="US-ASCII" > > The connection manager has no way of knowing if a connection is still > being used. No matter what it needs to be notified that the connection > can be re-claimed (and either kept alive for further re-use or > discarded). The #release method looks like a natural way of doing that. > > Oleg > Thanks - I'm still trying to grok, at a lower-level, the relationship between the connection, the manager, and the pool. I've got past the connection pool shutdown problem (my code). I'm now seeing ISE raised on an unexpectedly closed HttpConnection (stack trace below). I'm not getting this one, as the RequestExecutor is successfully sending the request, but it's erring out on the closed connection. Assuming that the connection is not shared across threads, and not being closed by another thread, what would be a cause of the unexpected connection close between the request and response? Thanks for your help. My suspicion is that there is still someone holding onto a connection, while in parallel, the connection manager from which that connection was provisioned is shutdown. I'm wondering if there might be another scenario. Caused by: java.lang.IllegalStateException: Connection is not open at org.apache.http.util.Asserts.check(Asserts.java:34) at org.apache.http.impl.BHttpConnectionBase.ensureOpen(BHttpConnectionBase.java:128) at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseEntity(DefaultBHttpClientConnection.java:172) at org.apache.http.impl.conn.CPoolProxy.receiveResponseEntity(CPoolProxy.java:157) at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273) at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:254) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184) --=_alternative 006CEC6B85257D55_=--