commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ying Chyn Ng" <yingc...@elock.com.my>
Subject DBCP deadlock. Is this bug DBCP-270?
Date Wed, 22 Jul 2009 12:55:04 GMT
Hello.

I encountered an issue that looks similar to Bug DBCP-270.
I wish to know:
1) Is it the same bug or a new one?
2) Which patch can I apply and how to apply it?
3) Will setting testWhileIdle="false" avoid the problem?

System info:
Tomcat 6.0.18, CentOS 5.2 64-bit, MySQL Connector/J 5.1.17
(I do not know which version of DBCP is bundled with Tomcat)

The partial thread dump and the JDBC config attached below.
I look forward to your kind assistance.  Thank you.

Regards,
Ying Chyn Ng
-----------------------------------------------------------------------

Found one Java-level deadlock:
=============================
"TP-Processor199":
  waiting to lock monitor 0x00002aaab043b980 (object 0x00002af7723e3c48, a org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool),
  which is held by "Timer-0"
"Timer-0":
  waiting to lock monitor 0x00000000168cf3b0 (object 0x00002af774c8e8b0, a org.apache.tomcat.dbcp.dbcp.PoolableConnection),
  which is held by "TP-Processor14"
"TP-Processor14":
  waiting to lock monitor 0x00002aaab043b980 (object 0x00002af7723e3c48, a org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool),
  which is held by "Timer-0"

Java stack information for the threads listed above:
===================================================
"TP-Processor199":
 at org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.getNumIdle(GenericObjectPool.java:1061)
 - waiting to lock <0x00002af7723e3c48> (a org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool)
 at org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool.java:78)
 at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96)
 at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
 ...

"Timer-0":
 at org.apache.tomcat.dbcp.dbcp.AbandonedTrace.addTrace(AbandonedTrace.java:176)
 - waiting to lock <0x00002af774c8e8b0> (a org.apache.tomcat.dbcp.dbcp.PoolableConnection)
 at org.apache.tomcat.dbcp.dbcp.AbandonedTrace.init(AbandonedTrace.java:92)
 at org.apache.tomcat.dbcp.dbcp.AbandonedTrace.<init>(AbandonedTrace.java:82)
 at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.<init>(DelegatingStatement.java:61)
 at org.apache.tomcat.dbcp.dbcp.DelegatingConnection.createStatement(DelegatingConnection.java:224)
 at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.validateConnection(PoolableConnectionFactory.java:331)
 at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.validateObject(PoolableConnectionFactory.java:312)
 at org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.evict(GenericObjectPool.java:1217)
 ...

"TP-Processor14":
 at org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.addObjectToPool(GenericObjectPool.java:1137)
 - waiting to lock <0x00002af7723e3c48> (a org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool)
 at org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.returnObject(GenericObjectPool.java:1076)
 at org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool.returnObject(AbandonedObjectPool.java:112)
 at org.apache.tomcat.dbcp.dbcp.PoolableConnection.close(PoolableConnection.java:87)
 - locked <0x00002af774c8e8b0> (a org.apache.tomcat.dbcp.dbcp.PoolableConnection)
 at org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.close(PoolingDataSource.java:181)
...

----------------------------------------------------------------
JDBC configuration

    <Resource name="jdbc/GRID_DS_MYSQL" auth="Container"
        type="javax.sql.DataSource"
        maxActive="450" maxIdle="50" maxWait="10000"
        removeAbandoned="true" removeAbandonedTimeout="120"
        validationQuery="Select 1" testOnBorrow="true" testWhileIdle="true"
        timeBetweenEvictionRunsMillis="10000" minEvictableIdleTimeMillis="60000"
        driverClassName="com.mysql.jdbc.Driver" username="grid" password="q1w2e3r4"
        url="jdbc:mysql://localhost:3306/gridbackend?autoReconnect=true"
   />

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message