#35 Still getting "APPARENT DEADLOCK"

closed
nobody
None
5
2006-09-22
2006-06-23
No

It looked from the changelog like c3p0-0.9.1-pre6.jar might fix this
problem, but I'm still getting it:

2006-06-23 10:16:25,078 [Timer-0] WARN
com.mchange.v2.async.ThreadPoolAsynchronousRunner -
com.mchange.v2.async.ThreadPoolAsynchronousRunner
$DeadlockDetector@1040d1 -- APPARENT DEADLOCK!!! Creating
emergency threads for unassigned pending tasks!
2006-06-23 10:16:25,079 [Timer-0] WARN
com.mchange.v2.async.ThreadPoolAsynchronousRunner -
com.mchange.v2.async.ThreadPoolAsynchronousRunner
$DeadlockDetector@1040d1 -- APPARENT DEADLOCK!!! Complete
Status: [num_managed_threads: 3, num_active: 3; activeTasks:
com.mchange.v2.resourcepool.BasicResourcePool$5@5ce05c
(com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-
#1), com.mchange.v2.resourcepool.BasicResourcePool$5@8dd1d8
(com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-
#2), com.mchange.v2.resourcepool.BasicResourcePool$5@cbf51f
(com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-
#0); pendingTasks: com.mchange.v2.resourcepool.BasicResourcePool
$5@49eb0c, com.mchange.v2.resourcepool.BasicResourcePool
$5@e670e0, com.mchange.v2.resourcepool.BasicResourcePool
$5@fc99aa, com.mchange.v2.c3p0.stmt.GooGooStatementCache
$2@cca363, com.mchange.v2.c3p0.stmt.GooGooStatementCache
$2@fadff9, com.mchange.v2.c3p0.stmt.GooGooStatementCache
$2@865c1d, com.mchange.v2.c3p0.stmt.GooGooStatementCache
$2@9b1bc, com.mchange.v2.c3p0.stmt.GooGooStatementCache
$2@73ccf2, com.mchange.v2.c3p0.stmt.GooGooStatementCache
$2@944884, com.mchange.v2.c3p0.stmt.GooGooStatementCache
$2@24d3f1, com.mchange.v2.c3p0.stmt.GooGooStatementCache
$2@d6b2e3, com.mchange.v2.c3p0.stmt.GooGooStatementCache
$2@7a811c, com.mchange.v2.c3p0.stmt.GooGooStatementCache
$2@b25689, com.mchange.v2.c3p0.stmt.GooGooStatementCache
$2@4f5973, com.mchange.v2.c3p0.stmt.GooGooStatementCache
$2@79b00e, com.mchange.v2.c3p0.stmt.GooGooStatementCache
$2@15828f, com.mchange.v2.c3p0.stmt.GooGooStatementCache
$2@2e9f41, com.mchange.v2.c3p0.stmt.GooGooStatementCache
$2@d9a418, com.mchange.v2.c3p0.stmt.GooGooStatementCache
$2@a4513a, com.mchange.v2.c3p0.stmt.GooGooStatementCache
$2@d0d3e3, com.mchange.v2.c3p0.stmt.GooGooStatementCache
$2@6f28e, com.mchange.v2.c3p0.stmt.GooGooStatementCache
$2@1e567e, com.mchange.v2.c3p0.stmt.GooGooStatementCache
$2@c09e0f, com.mchange.v2.c3p0.stmt.GooGooStatementCache
$2@c900b6, com.mchange.v2.c3p0.stmt.GooGooStatementCache
$2@4dd398, com.mchange.v2.c3p0.stmt.GooGooStatementCache
$2@7ede5f, com.mchange.v2.c3p0.stmt.GooGooStatementCache
$2@396284, com.mchange.v2.resourcepool.BasicResourcePool
$AsyncTestIdleResourceTask@72eb9d,
com.mchange.v2.resourcepool.BasicResourcePool
$AsyncTestIdleResourceTask@caae65]

From my hibernate.cfg.xml:

<property name="c3p0.min_size">0</property>
<property name="c3p0.max_size">8</property>
<property name="c3p0.acquire_increment">1</property>
<property name="c3p0.idle_test_period">10</property>
<property name="c3p0.timeout">60</property>
<property name="jdbc.batch_size">24</property>
<property name="max_fetch_depth">3</property>
<property name="cache.use_second_level_cache">false</
property>
<property name="cache.use_query_cache">false</property>

My c3p0.properties:

c3p0.preferredTestQuery = select 1
c3p0.maxStatementsPerConnection = 30

This is with c3p0 0.9.1-pre6, Hibernate 3.1.3, PostgreSQL 8.1.3, Java
1.5.0_06, OS X 10.4.6.

Let me know if you'd like me to run any specific diagnostics.

Discussion

  • Steve Waldman

    Steve Waldman - 2006-09-07

    Logged In: YES
    user_id=175530

    I think that this issue may finally be tracked down and
    fixed as of c3p0-0.9.1-pre7.

    (Even if it's not, at least you'll get better information
    about the problem. But I think it is actually resolved. The
    basic problem is that Connection destroy tasks depended
    wait()ed for certain StatementCache tasks to complete. But
    if all "helper threads" are saturated by resource destroy
    tasks, and all wait, the StatementCache tasks don't get to
    run. There were some other fragilities as well that might
    have prevented the wait()ing tasks from being notify()ed
    awake. Connection
    destroy tasks no longer wait or depend upon other tasks to
    complete.)

    Please give it a try, and let me know what happens!

     
  • Steve Waldman

    Steve Waldman - 2006-09-07
    • status: open --> pending
     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
  • SourceForge Robot

    • status: pending --> closed
     
  • Steve Waldman

    Steve Waldman - 2006-09-22

    Logged In: YES
    user_id=175530

    melquiades,

    Please try c3p0-0.9.1-pre7 (or better yet, wait a few hours
    until c3p0-0.9.1-pre9 is on SourceForge, later today).

    It is a fix in c3p0-0.9.1-pre7 that I think, hope, finally
    resolved this issue. Do try either of the more recent
    releases, and let me know whether you still get these
    deadlocks. (I think you won't, but I've been wrong before!)

    Thanks!

    (BTW, even if you do see APPARENT DEADLOCK messages, you'll
    find them much more readable in 0.9.1-pre7 and above... so
    you'll definitely have a noticeable change to look forward tp.)

     
  • icebrain2

    icebrain2 - 2007-06-26

    Logged In: YES
    user_id=1828926
    Originator: NO

    I´m still getting this error with version 0.9.1.2.

    Using hibernate 3.0
    MySql 5.0

    My config file:
    <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/mktmanager</property> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
    <property name="hibernate.connection.autoReconnect">true</property> <property name="hibernate.connection.username">root</property>
    <property name="hibernate.connection.password">macaco</property>
    <property name="hibernate.c3p0.acquire_increment">1</property>
    <property name="hibernate.c3p0.idle_test_period">100</property> <!-- seconds -->
    <property name="hibernate.c3p0.max_size">100</property>
    <property name="hibernate.c3p0.max_statements">0</property>
    <property name="hibernate.c3p0.min_size">10</property>
    <property name="hibernate.c3p0.timeout">100</property> <!-- seconds -->

    The stack trace:
    16149615 [Timer-0] WARN com.mchange.v2.async.ThreadPoolAsynchronousRunner - com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@d96b45 -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks!
    16149631 [Timer-0] WARN com.mchange.v2.async.ThreadPoolAsynchronousRunner - com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@d96b45 -- APPARENT DEADLOCK!!! Complete Status:
    Managed Threads: 3
    Active Threads: 3
    Active Tasks:
    com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1f523a3 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2)
    com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@f6ab8a (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0)
    com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@782d03 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1)
    Pending Tasks:
    com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1d3589e
    com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@5ef73d
    Pool thread stack traces:
    Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2,5,main]
    java.net.SocketInputStream.socketRead0(Native Method)
    java.net.SocketInputStream.read(SocketInputStream.java:129)
    com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113)
    com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:160)
    com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:188)
    com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1862)
    com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:493)
    com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:936)
    com.mysql.jdbc.Connection.createNewIO(Connection.java:2720)
    com.mysql.jdbc.Connection.<init>(Connection.java:1509)
    com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
    com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
    com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
    com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
    com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
    com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
    com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
    com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
    com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
    Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1,5,main]
    java.net.SocketInputStream.socketRead0(Native Method)
    java.net.SocketInputStream.read(SocketInputStream.java:129)
    com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113)
    com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:160)
    com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:188)
    com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1862)
    com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:493)
    com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:936)
    com.mysql.jdbc.Connection.createNewIO(Connection.java:2720)
    com.mysql.jdbc.Connection.<init>(Connection.java:1509)
    com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
    com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
    com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
    com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
    com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
    com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
    com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
    com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
    com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
    Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0,5,main]
    java.net.SocketInputStream.socketRead0(Native Method)
    java.net.SocketInputStream.read(SocketInputStream.java:129)
    com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113)
    com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:160)
    com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:188)
    com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1862)
    com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:493)
    com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:936)
    com.mysql.jdbc.Connection.createNewIO(Connection.java:2720)
    com.mysql.jdbc.Connection.<init>(Connection.java:1509)
    com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
    com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
    com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
    com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
    com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
    com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
    com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
    com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
    com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)

    Thanks in advance!

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks