Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 68983 invoked from network); 24 Nov 2006 16:04:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Nov 2006 16:04:26 -0000 Received: (qmail 74150 invoked by uid 500); 24 Nov 2006 16:04:34 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 74059 invoked by uid 500); 24 Nov 2006 16:04:34 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 74048 invoked by uid 99); 24 Nov 2006 16:04:34 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Nov 2006 08:04:34 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Nov 2006 08:04:24 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D30537142D1 for ; Fri, 24 Nov 2006 08:04:03 -0800 (PST) Message-ID: <7378939.1164384243861.JavaMail.jira@brutus> Date: Fri, 24 Nov 2006 08:04:03 -0800 (PST) From: "Phil Steitz (JIRA)" To: commons-dev@jakarta.apache.org Subject: [jira] Commented: (DBCP-65) [dbcp] Deadlock when evicting dbcp objects (testWhileIdle=true) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ http://issues.apache.org/jira/browse/DBCP-65?page=comments#action_12452488 ] Phil Steitz commented on DBCP-65: --------------------------------- I am +1 on option 2, or just migrate to Pool 2 when it is released. Having spent many hours trying to find workarounds for this and DBCP-44 (trying to do things like 1 outside of [pool], which is hopeless), I agree that the current evictor setup is a recipe for deadlocks and can't be fixed without changes to [pool] or [dbcp] config semantics. > [dbcp] Deadlock when evicting dbcp objects (testWhileIdle=true) > --------------------------------------------------------------- > > Key: DBCP-65 > URL: http://issues.apache.org/jira/browse/DBCP-65 > Project: Commons Dbcp > Issue Type: Bug > Environment: Operating System: All > Platform: All > Reporter: Wang Xianzhu > Fix For: 1.3 > > > The GenericKeyedObjectPool$Evictor thread has probability of deadlock with dbcp > objects. > For example, at a certain time, a normal user thread calls a PoolingConnection > object's synchronized method, which in turn calls GenericKeyedObjectPool > object's synchronzied method. > At the same time, the evictor thread calls the GenericKeyedObjectPool object's > synchronized method 'evict', which in turn calls the PoolingConnection object's > synchronized method. When testWhileIdle=true, the probability of evictor > calling GenericKeyedObjectPool's synchronized method is much greater. > The following is the deadlock information in the thread dump of our program > (testWhileIdle=true): > "Thread-106": > at org.apache.commons.dbcp.AbandonedTrace.removeTrace(AbandonedTrace.java:221) > - waiting to lock <0x6a6b1b80> (a org.apache.commons.dbcp.PoolingConnection) > at > org.apache.commons.dbcp.PoolablePreparedStatement.passivate(PoolablePreparedStatement.java:100) > at > org.apache.commons.dbcp.PoolingConnection.passivateObject(PoolingConnection.java:239) > at > org.apache.commons.pool.impl.GenericKeyedObjectPool.evict(GenericKeyedObjectPool.java:1001) > - locked <0x6a6b1858> (a org.apache.commons.pool.impl.GenericKeyedObjectPool) > at > org.apache.commons.pool.impl.GenericKeyedObjectPool$Evictor.run(GenericKeyedObjectPool.java:1156) > at java.lang.Thread.run(Thread.java:534) > "Thread-41": > at > org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:715) > - waiting to lock <0x6a6b1858> (a > org.apache.commons.pool.impl.GenericKeyedObjectPool) > at > org.apache.commons.dbcp.PoolingConnection.prepareStatement(PoolingConnection.java:87) > - locked <0x6a6b1b80> (a org.apache.commons.dbcp.PoolingConnection) > at > org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:185) > at > org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:278) > ... > This problem can be worked around by setting testWhileIdle to false, although > there is still very small possibility of deadlock. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org