#108 deadlocks in c3p0-0.9.2-pre1.jar

closed-fixed
nobody
None
5
2012-05-28
2012-05-28
Anonymous
No

the phenonimon is that my app run out of jdbc database pools, so my app seem be dead.

the thread name "C3P0PooledConnectionPoolManager-Helper Thread", so i guess it is a bug of c3p0 0.9.2.1 pre1.

Found one Java-level deadlock:

"C3P0PooledConnectionPoolManager-Helper Thread-#2":
waiting to lock monitor 0x000000004224afd8 (object 0x00007f22ecdbebd0, a com.mysql.jdbc.JDBC4ResultSet),
which is held by "C3P0PooledConnectionPoolManager-Helper Thread-#1"
"C3P0PooledConnectionPoolManager-Helper Thread-#1":
waiting to lock monitor 0x00000000415c7250 (object 0x00007f22bd130bd8, a com.mysql.jdbc.JDBC4Connection),
which is held by "C3P0PooledConnectionPoolManager-Helper Thread-#2"

Java stack information for the threads listed above:

"C3P0PooledConnectionPoolManager-Helper Thread-#2":
at com.mysql.jdbc.ResultSetImpl.realClose(ResultSetImpl.java:7477)
- waiting to lock <0x00007f22ecdbebd0> (a com.mysql.jdbc.JDBC4ResultSet)
at com.mysql.jdbc.ResultSetImpl.close(ResultSetImpl.java:907)
at com.mysql.jdbc.StatementImpl.realClose(StatementImpl.java:2430)
- locked <0x00007f22ed1137c0> (a com.mysql.jdbc.StatementImpl)
at com.mysql.jdbc.ConnectionImpl.closeAllOpenStatements(ConnectionImpl.java:1585)
at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4361)
at com.mysql.jdbc.ConnectionImpl.close(ConnectionImpl.java:1557)
- locked <0x00007f22bd130bd8> (a com.mysql.jdbc.JDBC4Connection)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:589)
at com.mchange.v2.c3p0.impl.NewPooledConnection.closeMaybeCheckedOut(NewPooledConnection.java:239)
- locked <0x00007f22ecb14a08> (a com.mchange.v2.c3p0.impl.NewPooledConnection)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:545)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:1012)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:620)
"C3P0PooledConnectionPoolManager-Helper Thread-#1":
at com.mysql.jdbc.ConnectionImpl.getCharacterSetMetadata(ConnectionImpl.java:2799)
- waiting to lock <0x00007f22bd130bd8> (a com.mysql.jdbc.JDBC4Connection)
at com.mysql.jdbc.Field.getStringFromBytes(Field.java:710)
at com.mysql.jdbc.Field.getName(Field.java:624)
at com.mysql.jdbc.ResultSetImpl.buildIndexMapping(ResultSetImpl.java:750)
at com.mysql.jdbc.ResultSetImpl.findColumn(ResultSetImpl.java:1108)
- locked <0x00007f22ecdbebd0> (a com.mysql.jdbc.JDBC4ResultSet)
at com.mysql.jdbc.DatabaseMetaData$9.forEach(DatabaseMetaData.java:5030)
at com.mysql.jdbc.IterateBlock.doForAll(IterateBlock.java:51)
at com.mysql.jdbc.DatabaseMetaData.getTables(DatabaseMetaData.java:4962)
at com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnectionNoQuery(DefaultConnectionTester.java:185)
at com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnection(DefaultConnectionTester.java:62)
at com.mchange.v2.c3p0.AbstractConnectionTester.activeCheckConnection(AbstractConnectionTester.java:67)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.testPooledConnection(C3P0PooledConnectionPool.java:433)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.testPooledConnection(C3P0PooledConnectionPool.java:393)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.refurbishIdleResource(C3P0PooledConnectionPool.java:369)
at com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask.run(BasicResourcePool.java:2137)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:620)

Found one Java-level deadlock:

"C3P0PooledConnectionPoolManager-Helper Thread-#2":
waiting to lock monitor 0x00000000415f0a78 (object 0x00007f2296b02810, a com.mysql.jdbc.JDBC4Connection),
which is held by "C3P0PooledConnectionPoolManager-Helper Thread-#1"
"C3P0PooledConnectionPoolManager-Helper Thread-#1":
waiting to lock monitor 0x0000000042473b78 (object 0x00007f22be914700, a com.mysql.jdbc.JDBC4ResultSet),
which is held by "C3P0PooledConnectionPoolManager-Helper Thread-#2"

Java stack information for the threads listed above:

"C3P0PooledConnectionPoolManager-Helper Thread-#2":
at com.mysql.jdbc.ConnectionImpl.getCharacterSetMetadata(ConnectionImpl.java:2799)
- waiting to lock <0x00007f2296b02810> (a com.mysql.jdbc.JDBC4Connection)
at com.mysql.jdbc.Field.getStringFromBytes(Field.java:710)
at com.mysql.jdbc.Field.getOriginalName(Field.java:652)
at com.mysql.jdbc.ResultSetImpl.buildIndexMapping(ResultSetImpl.java:749)
at com.mysql.jdbc.ResultSetImpl.findColumn(ResultSetImpl.java:1108)
- locked <0x00007f22be914700> (a com.mysql.jdbc.JDBC4ResultSet)
at com.mysql.jdbc.DatabaseMetaData$9.forEach(DatabaseMetaData.java:5030)
at com.mysql.jdbc.IterateBlock.doForAll(IterateBlock.java:51)
at com.mysql.jdbc.DatabaseMetaData.getTables(DatabaseMetaData.java:4962)
at com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnectionNoQuery(DefaultConnectionTester.java:185)
at com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnection(DefaultConnectionTester.java:62)
at com.mchange.v2.c3p0.AbstractConnectionTester.activeCheckConnection(AbstractConnectionTester.java:67)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.testPooledConnection(C3P0PooledConnectionPool.java:433)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.testPooledConnection(C3P0PooledConnectionPool.java:393)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.refurbishIdleResource(C3P0PooledConnectionPool.java:369)
at com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask.run(BasicResourcePool.java:2137)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:620)
"C3P0PooledConnectionPoolManager-Helper Thread-#1":
at com.mysql.jdbc.ResultSetImpl.realClose(ResultSetImpl.java:7477)
- waiting to lock <0x00007f22be914700> (a com.mysql.jdbc.JDBC4ResultSet)
at com.mysql.jdbc.ResultSetImpl.close(ResultSetImpl.java:907)
at com.mysql.jdbc.StatementImpl.realClose(StatementImpl.java:2430)
- locked <0x00007f22bda29ce8> (a com.mysql.jdbc.StatementImpl)
at com.mysql.jdbc.ConnectionImpl.closeAllOpenStatements(ConnectionImpl.java:1585)
at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4361)
at com.mysql.jdbc.ConnectionImpl.close(ConnectionImpl.java:1557)
- locked <0x00007f2296b02810> (a com.mysql.jdbc.JDBC4Connection)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:589)
at com.mchange.v2.c3p0.impl.NewPooledConnection.closeMaybeCheckedOut(NewPooledConnection.java:239)
- locked <0x00007f2296fea3f0> (a com.mchange.v2.c3p0.impl.NewPooledConnection)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:545)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:1012)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:620)

Found 2 deadlocks.

Discussion

  • Steve Waldman
    Steve Waldman
    2012-05-28

    • status: open --> closed-fixed