Return-Path: X-Original-To: apmail-hc-commits-archive@www.apache.org Delivered-To: apmail-hc-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DAD54679D for ; Wed, 22 Jun 2011 14:09:31 +0000 (UTC) Received: (qmail 76515 invoked by uid 500); 22 Jun 2011 14:09:31 -0000 Delivered-To: apmail-hc-commits-archive@hc.apache.org Received: (qmail 76473 invoked by uid 500); 22 Jun 2011 14:09:31 -0000 Mailing-List: contact commits-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 commits@hc.apache.org Received: (qmail 76466 invoked by uid 99); 22 Jun 2011 14:09:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jun 2011 14:09:31 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jun 2011 14:09:30 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 20DF323889EC; Wed, 22 Jun 2011 14:09:10 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1138473 - /httpcomponents/httpclient/branches/trunk-adaptive-connpool/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java Date: Wed, 22 Jun 2011 14:09:10 -0000 To: commits@hc.apache.org From: jonm@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110622140910.20DF323889EC@eris.apache.org> Author: jonm Date: Wed Jun 22 14:09:09 2011 New Revision: 1138473 URL: http://svn.apache.org/viewvc?rev=1138473&view=rev Log: HTTPCLIENT-1101: Do not catch Throwables that come out of executing through a RequestDirector, but rather limit ourselves to catching Exceptions and RuntimeExceptions when considering backoff strategies. Modified: httpcomponents/httpclient/branches/trunk-adaptive-connpool/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java Modified: httpcomponents/httpclient/branches/trunk-adaptive-connpool/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/trunk-adaptive-connpool/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java?rev=1138473&r1=1138472&r2=1138473&view=diff ============================================================================== --- httpcomponents/httpclient/branches/trunk-adaptive-connpool/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java (original) +++ httpcomponents/httpclient/branches/trunk-adaptive-connpool/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java Wed Jun 22 14:09:09 2011 @@ -860,15 +860,18 @@ public abstract class AbstractHttpClient HttpResponse out; try { out = director.execute(target, request, execContext); - } catch (Throwable t) { - if (getConnectionBackoffStrategy().shouldBackoff(t)) { + } catch (RuntimeException re) { + if (getConnectionBackoffStrategy().shouldBackoff(re)) { getBackoffManager().backOff(route); } - if (t instanceof Error) throw (Error)t; - if (t instanceof RuntimeException) throw (RuntimeException)t; - if (t instanceof HttpException) throw (HttpException)t; - if (t instanceof IOException) throw (IOException)t; - throw new RuntimeException("unexpected exception", t); + throw re; + } catch (Exception e) { + if (getConnectionBackoffStrategy().shouldBackoff(e)) { + getBackoffManager().backOff(route); + } + if (e instanceof HttpException) throw (HttpException)e; + if (e instanceof IOException) throw (IOException)e; + throw new RuntimeException("unexpected exception", e); } if (getConnectionBackoffStrategy().shouldBackoff(out)) { getBackoffManager().backOff(route);