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 6BA5010707 for ; Sun, 27 Oct 2013 10:05:16 +0000 (UTC) Received: (qmail 31554 invoked by uid 500); 27 Oct 2013 10:05:14 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 31309 invoked by uid 500); 27 Oct 2013 10:05:13 -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 31292 invoked by uid 99); 27 Oct 2013 10:05:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 Oct 2013 10:05:09 +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; Sun, 27 Oct 2013 10:05:02 +0000 Received: from [192.168.1.121] (77-57-198-202.dclient.hispeed.ch [77.57.198.202]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by kalnich.nine.ch (Postfix) with ESMTPSA id 4DB08B800A5; Sun, 27 Oct 2013 11:04:41 +0100 (CET) Message-ID: <1382868280.14051.4.camel@ubuntu> Subject: Re: Intermittent ConnectionClosedException with httpasynclient. From: Oleg Kalnichevski To: Jaikit Savla Cc: HttpClient User Discussion Date: Sun, 27 Oct 2013 11:04:40 +0100 In-Reply-To: <1382683193.78246.YahooMailNeo@web142803.mail.bf1.yahoo.com> References: <1382682813.74660.YahooMailNeo@web142805.mail.bf1.yahoo.com> <1382683193.78246.YahooMailNeo@web142803.mail.bf1.yahoo.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, 2013-10-24 at 23:39 -0700, Jaikit Savla wrote: > Also one thing which is puzzling me is that most of the time (95%) this exception is returned in 0 - 1ms. > > Jaikit This can usually happen when a persistent connection expires while being leased from the pool. This can happen. The only way way to mitigate this problem is to pro-actively evict persistent connections from the pool after a certain period of inactivity. I would also strongly advise upgrading to the latest SVN snapshot. Oleg > > On Thursday, October 24, 2013 11:33 PM, Jaikit Savla wrote: > > Hello Mates, > > I am using Apache Async Httpclient 4.0 BETA3 > Intermittently I am receiving ConnectionClosedException in my async failed callback. Looking at the async httpclient code - it returns ConnectionClosedException when data read is -1. Doc also says that "Signals that the connection has been closed unexpectedly.". Trying to understand at which end (server or client) connection was closed ? Can this be related to any tcp setting on client or server side which might be causing this ? > > Is it possible to detect this and retry request ? > > Appreciate any pointers. > > Thanks > > stack trace: > org.apache.http.ConnectionClosedException: Connection closed > > at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.endOfInput(HttpAsyncRequestExecutor.java:261) > at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:186) > at org.apache.http.impl.nio.DefaultHttpClientIODispatch.onInputReady(DefaultHttpClientIODispatch.java:125) > at org.apache.http.impl.nio.DefaultHttpClientIODispatch.onInputReady(DefaultHttpClientIODispatch.java:50) > at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:112) > at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:160) > at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:342) > at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:320) > at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:280) > at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106) --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org For additional commands, e-mail: httpclient-users-help@hc.apache.org