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 EC34CDB99 for ; Thu, 30 Aug 2012 20:37:07 +0000 (UTC) Received: (qmail 95279 invoked by uid 500); 30 Aug 2012 20:37:07 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 95225 invoked by uid 500); 30 Aug 2012 20:37:07 -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 95098 invoked by uid 99); 30 Aug 2012 20:37:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Aug 2012 20:37:07 +0000 Date: Fri, 31 Aug 2012 07:37:07 +1100 (NCT) From: "Jonathan Burke (JIRA)" To: dev@hc.apache.org Message-ID: <1992043075.18141.1346359027598.JavaMail.jiratomcat@arcas> In-Reply-To: <2123545851.18139.1346358907841.JavaMail.jiratomcat@arcas> Subject: [jira] [Updated] (HTTPCLIENT-1229) @ThreadSafe BasicClientConnectionManager is not threadsafe with respect to shutdown MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HTTPCLIENT-1229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jonathan Burke updated HTTPCLIENT-1229: --------------------------------------- Attachment: stackTrace.txt A stack trace generated by the attached test. > @ThreadSafe BasicClientConnectionManager is not threadsafe with respect to shutdown > ----------------------------------------------------------------------------------- > > Key: HTTPCLIENT-1229 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1229 > Project: HttpComponents HttpClient > Issue Type: Bug > Components: HttpConn > Affects Versions: 4.2.1 > Reporter: Jonathan Burke > Priority: Minor > Attachments: BasicClientConnectionManager.java, stackTrace.txt, test.txt > > > Since the assignment to variable shutdown in the shutdown method (line 262) is not part of the synchronize block and none of the assertNotShutdown method calls are within the synchronized blocks of their enclosing methods, it is possible to have threads execute the commands of BasicClientConnectionManager methods in the following sequence. > Thread 1 > releaseConnection (or some other method that uses assertNotShutdown is called) > assertNotShutdown - Passes - Line 183 > Thread 2 > shutdown > the shutdown flag becomes true - Line 262 > shutdown releases this.poolEntry and this.conn in the synchronized(this) block > > Thread 1 > release connection's synchronized(this) block get's executed > this.poolEntry is null in the try block causing a null pointer exception - Line 211 > this.poolEntry is null in the finally block causing a null pointer exception - Line 224 -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org