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 48D0510702 for ; Sat, 22 Feb 2014 14:10:36 +0000 (UTC) Received: (qmail 80398 invoked by uid 500); 22 Feb 2014 14:10:35 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 80373 invoked by uid 500); 22 Feb 2014 14:10:34 -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 80364 invoked by uid 99); 22 Feb 2014 14:10:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Feb 2014 14:10:34 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [5.148.180.21] (HELO kalnich2.nine.ch) (5.148.180.21) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Feb 2014 14:10:28 +0000 Received: from [10.80.117.112] (unknown [91.137.20.132]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by kalnich2.nine.ch (Postfix) with ESMTPSA id F27421600A8 for ; Sat, 22 Feb 2014 14:10:04 +0000 (UTC) Message-ID: <1393078203.7471.22.camel@ubuntu> Subject: Re: Handling idle timeout disconnect From: Oleg Kalnichevski To: HttpComponents Project Date: Sat, 22 Feb 2014 15:10:03 +0100 In-Reply-To: References: 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 Fri, 2014-02-21 at 23:07 +0000, sebb wrote: > Further to the recent email about unexpected behaviour in JMeter when > staleCheck was disabled, the cause has been determined. > > The problem was caused by a server operating an idle timeout policy, > but failing to send a Keep-Alive header with the timeout information. > 'Keep-Alive' is a non-standard header. Web servers do not have to support it. > Thus the HC code did not know that the connection would timeout, and > tried to re-use it. > This resulted in an immediate disconnect. > Since JMeter does not retry by default, this caused the sample to fail. > > I'm wondering whether this scenario should be handled automatically by HC. > It could in theory happen even with servers that send the Keep-Alive > header if the server and client ideas of elapsed time are not very > consistent. > > The idea would be to retry the request IFF the connect immediately > fails - i.e. before any data has been sent. > > This could not cause a problem with non-idempotent requests, as the > request would not actually have been sent. > > Does that sound reasonable, or is it something the app developer needs > to implement in a retry handler? > I believe we already all these features in HttpClient. All you need is to activate the default retry handler with retry count 1. Give it a shot. Cheers Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org