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 417F110D07 for ; Thu, 30 Jan 2014 09:09:32 +0000 (UTC) Received: (qmail 43448 invoked by uid 500); 30 Jan 2014 09:09:31 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 43404 invoked by uid 500); 30 Jan 2014 09:09:30 -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 43396 invoked by uid 99); 30 Jan 2014 09:09:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Jan 2014 09:09:30 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [217.150.250.48] (HELO kalnich.nine.ch) (217.150.250.48) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Jan 2014 09:09:23 +0000 Received: from [192.168.42.63] (unknown [213.55.184.246]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by kalnich.nine.ch (Postfix) with ESMTPSA id 1BECEB8005A for ; Thu, 30 Jan 2014 10:09:03 +0100 (CET) Message-ID: <1391072941.5241.4.camel@ubuntu> Subject: Re: Cancel and socket state From: Oleg Kalnichevski To: HttpClient User Discussion Date: Thu, 30 Jan 2014 10:09:01 +0100 In-Reply-To: References: <1390985193.24336.1.camel@ubuntu> <1390990185.24336.18.camel@ubuntu> <1391004263.24336.25.camel@ubuntu> <1391012647.32684.3.camel@ubuntu> <26595f84-8167-4321-b523-ae819a755725@email.android.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.8.4-0ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Thu, 2014-01-30 at 09:49 +0100, Thomas Boniface wrote: > In case I don't do the cancel the connection is released and only > disconnected once the keep alive timeout is reached. > This is a very important bit of information. I'll see if I can reproduce the same behavior locally. > I experience a file descriptor leak in my tomcat process and I was > suspecting the request cancellation may be the source cause but it appears > it does not as not canceling the request do not solve the issue. Though I > was expecting that canceling the request would get the connection back in > the pool sooner that letting the request I don't need anymore finish. > Please note that if an HTTP exchange cannot be fully completed the underlying connection is simply unsafe to re-use and needs to be discarded. Oleg > I will try to reproduce my leak issue in a simpler context. > > Thomas > > > 2014-01-29 Oleg Kalnichevski : > > > On January 29, 2014 5:38:13 PM CET, Thomas Boniface > > wrote: > > >Thanks for your help regarding the snapshot. Here is an updated log > > >using > > >the 4.0.1-SNAPSHOT. > > > > > >Regarding request cancel, it is done as follow: > > > > > >if (futureHttpResponse != null && !futureHttpResponse.isCancelled()) { > > > futureHttpResponse.cancel(true); > > >} > > > > > >where futureHttpResponse what the object return by the execute call. > > > > > >Thomas > > > > Thomas, > > I am sorry I cannot reduce the cause of the problem just by looking at the > > log. > > > > What happens if you do not cancel the request? Does the connection get > > returned to the pool? > > > > 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