Re: [C3p0-users] Apparent deadlock with Postgres after resetting the connection pool
Status: Beta
Brought to you by:
swaldman
From: Steve W. <swa...@mc...> - 2006-10-17 09:28:48
|
Jon, Please try c3p0-0.9.1-pre9. This release resolves many "APPARENT DEADLOCK"s, and in any case provides a lot more information about what's going on should an APPARENT DEADLOCK occur. When you say "the system deadlocks", does it recover following the APPARENT DEADLOCK warning? (It should.) Anyway, please try c3p0-0.9.1- pre9, and report back with either the good news that the deadlock has gone away, or the full status dump if it has not. Thanks! Steve p.s. c3p0-0.9.1-pre9 is quite mature. Unless I receive reports of unexpected problems, there will be one more minor prerelease (to expose statement cache statistics in JMX), and then c3p0-0.9.1 will go final. --- Steve Waldman Machinery For Change, Inc. On Oct 17, 2006, at 11:06 AM, Jon Skeet wrote: > I'm using C3P0 0.9.0.3 with JDK 1.5, Hibernate 3.2, and Postgres 8.1 > running on Linux. > > Periodically, we manually "vacuum analyze" the database (when we've > made > major changes) and wish to purge the connection pool when we've > done so, > as we believe new connections benefit from the vacuum more than old > ones > (due to updated statistics). > > To achieve that end, we call softResetAllUsers on the > PooledDataSource. > Unfortunately, if we then try to prepare a statement, the system > deadlocks and (at least in unit tests) issues a warning: > > 08:03:19,639 WARN ThreadPoolAsynchronousRunner:429 - > com.mchange.v2.async.ThreadPoolAsynchronousRunner > $DeadlockDetector@18e60 > 9b > -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned > pending tasks! > 08:03:19,640 WARN ThreadPoolAsynchronousRunner:435 - > com.mchange.v2.async.ThreadPoolAsynchronousRunner > $DeadlockDetector@18e60 > 9b > -- APPARENT DEADLOCK!!! Complete Status: [num_managed_threads: 3, > num_active: 3; activeTasks: > com.mchange.v2.resourcepool.BasicResourcePool$5@687ea9 > (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0), > com.mchange.v2.resourcepool.BasicResourcePool$5@538974 > (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1), > com.mchange.v2.resourcepool.BasicResourcePool$5@6545d2 > (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2); > pendingTasks: > com.mchange.v2.resourcepool.BasicResourcePool$5@cade31, > com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@c1a0eb, > com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@2bccb2, > com.mchange.v2.c3p0.stmt.GooGooStatementCache$2@18bbf55, > com.mchange.v2.c3p0.stmt.GooGooStatementCache$2@1be8711, > com.mchange.v2.c3p0.stmt.GooGooStatementCache$2@1958cc2, > com.mchange.v2.c3p0.stmt.GooGooStatementCache$2@14c28db, > com.mchange.v2.c3p0.stmt.GooGooStatementCache$2@10e687b, > com.mchange.v2.c3p0.stmt.GooGooStatementCache$2@ed9f47, > com.mchange.v2.c3p0.stmt.GooGooStatementCache$2@73f0d8, > com.mchange.v2.c3p0.stmt.GooGooStatementCache$2@1c8fb4b, > com.mchange.v2.c3p0.stmt.GooGooStatementCache$3@1ea0105] > > I've found that by putting a sleep for a couple of seconds after the > call to softResetAllUsers, I can get all the unit tests to pass - but > it's hardly a situation I'm comfortable with. > > I can reproduce this fairly easily, and I can *reasonably* easily > update > the version of C3P0 I'm working with, so if anyone could suggest a way > for me to patch c3p0 (or just do things differently!) to fix this > issue, > that would be extremely useful. > > > Jon Skeet > Principal Software Engineer > CLEARSWIFT > Simplifying content security > > DDI: +44 (0) 1189 038 109 > Mobile: +44 (0) 7970 158 865 > Switchboard: +44 (0) 1189 038 903 > Fax: +44 (0) 1189 039 000 > Web: www.clearswift.com > > ---------------------------------------------------------------------- > --- > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your > job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > c3p0-users mailing list > c3p...@li... > https://lists.sourceforge.net/lists/listinfo/c3p0-users |