Return-Path: Delivered-To: apmail-hc-dev-archive@www.apache.org Received: (qmail 79419 invoked from network); 9 Dec 2010 23:55:26 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Dec 2010 23:55:26 -0000 Received: (qmail 49807 invoked by uid 500); 9 Dec 2010 23:55:26 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 49737 invoked by uid 500); 9 Dec 2010 23:55:25 -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 49726 invoked by uid 99); 9 Dec 2010 23:55:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Dec 2010 23:55:25 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Dec 2010 23:55:23 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oB9Nt1Z4027126 for ; Thu, 9 Dec 2010 23:55:01 GMT Message-ID: <4611087.49701291938901473.JavaMail.jira@thor> Date: Thu, 9 Dec 2010 18:55:01 -0500 (EST) From: "Bryan Pon (JIRA)" To: dev@hc.apache.org Subject: [jira] Created: (HTTPCORE-246) ThrottlingHttpClientHandler triggers EventListener.connectionClosed twice MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org ThrottlingHttpClientHandler triggers EventListener.connectionClosed twice ------------------------------------------------------------------------- Key: HTTPCORE-246 URL: https://issues.apache.org/jira/browse/HTTPCORE-246 Project: HttpComponents HttpCore Issue Type: Bug Affects Versions: 4.1 Environment: Linux 2.6.32-26-generic #47-Ubuntu Reporter: Bryan Pon Priority: Minor In ThrottlingHttpClientHandler.closed(NHttpClientConnection), connectionClosed() is called twice on the event listener: if (this.eventListener != null) { this.eventListener.connectionClosed(conn); } this.execHandler.finalizeContext(context); if (this.eventListener != null) { this.eventListener.connectionClosed(conn); } I'm not sure if this is intentional (looks unlikely), but I have a use case where this causes problems. I want to start a new connection whenever one is closed, so in the EventListener.connectionClosed() method I am invoking ConnectingIOReactor.connect(). Since connectionClosed() is triggered twice, this is opening two new connections. I can work around the issue by checking if connectionClosed() has already been called. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org