Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEADLOCK in C3P0PooledConnectionPoolManager when calling java.net.InetAddress.getLocalHost #153

Open
erajasekar opened this issue Sep 24, 2020 · 1 comment

Comments

@erajasekar
Copy link

I am getting this error in during application startup with it connects to Oracle DB running in a virtual box:

X20200924182802.072Uninitialized129Uninitialized`Uninitialized``Uninitialized`WARN`com.mchange.v2.async.ThreadPoolAsynchronousRunner`com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@67237c3e -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks! X`20200924182802.075`Uninitialized`129UninitializedUninitialized``UninitializedWARNcom.mchange.v2.async.ThreadPoolAsynchronousRunnercom.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@67237c3e -- APPARENT DEADLOCK!!! Complete Status:
Managed Threads: 3
Active Threads: 3
Active Tasks:
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@54e7df38
on thread: C3P0PooledConnectionPoolManager[identityToken->2u1lo5ac1hnhzmq1ul0o8t|18bedf20]-HelperThread-#0
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@19bb1ac0
on thread: C3P0PooledConnectionPoolManager[identityToken->2u1lo5ac1hnhzmq1ul0o8t|18bedf20]-HelperThread-#1
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@2c6f0fde
on thread: C3P0PooledConnectionPoolManager[identityToken->2u1lo5ac1hnhzmq1ul0o8t|18bedf20]-HelperThread-#2
Pending Tasks:
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@48f66bde
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@220273e7
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@632e007d
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@376be239

Pool thread stack traces:
Thread[C3P0PooledConnectionPoolManager[identityToken->2u1lo5ac1hnhzmq1ul0o8t|18bedf20]-HelperThread-#1,5,main]
java.net.InetAddress.getLocalHost(InetAddress.java:1486)
oracle.jdbc.driver.T4CTTIoauthenticate.setSessionFields(T4CTTIoauthenticate.java:945)
oracle.jdbc.driver.T4CTTIoauthenticate.(T4CTTIoauthenticate.java:238)
oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:401)
oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:553)
oracle.jdbc.driver.T4CConnection.(T4CConnection.java:254)
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220)
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:214)
com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138)
com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125)
com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44)
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870)
com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)
Thread[C3P0PooledConnectionPoolManager[identityToken->2u1lo5ac1hnhzmq1ul0o8t|18bedf20]-HelperThread-#2,5,main]
java.net.InetAddress.getLocalHost(InetAddress.java:1486)
oracle.jdbc.driver.T4CTTIoauthenticate.setSessionFields(T4CTTIoauthenticate.java:945)
oracle.jdbc.driver.T4CTTIoauthenticate.(T4CTTIoauthenticate.java:238)
oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:401)
oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:553)
oracle.jdbc.driver.T4CConnection.(T4CConnection.java:254)
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220)
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:214)
com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138)
com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125)
com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44)
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870)
com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)
Thread[C3P0PooledConnectionPoolManager[identityToken->2u1lo5ac1hnhzmq1ul0o8t|18bedf20]-HelperThread-#0,5,main]
java.net.InetAddress.getLocalHost(InetAddress.java:1486)
oracle.jdbc.driver.T4CTTIoauthenticate.setSessionFields(T4CTTIoauthenticate.java:945)
oracle.jdbc.driver.T4CTTIoauthenticate.(T4CTTIoauthenticate.java:238)
oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:401)
oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:553)
oracle.jdbc.driver.T4CConnection.(T4CConnection.java:254)
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220)
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:214)
com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138)
com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125)
com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44)
com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870)
com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)`

Any pointers on how to resolve this?

@swaldman
Copy link
Owner

Three years later I suspect you've resolved this, but the problem is that calls to getLocalHost(...) are neither succeeding promptly nor failing with an Exception, either of which c3p0 can deal with. They are hanging indefinitely.

c3p0 includes a workaround that can help -- maxAdministrativeTaskTime -- but it's best to understand and resolve the hang.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants