最新c3p0的明显死锁

o3imoua4  于 2021-06-20  发布在  Mysql
关注(0)|答案(1)|浏览(520)

我正在使用Hibernate5.1.0和C3P00.9.5.1。我没有启用缓存 Apparent Deadlock 错误。

(C3P0PooledConnectionPoolManager[identityToken->2v2d5k9y3ipope1s0apgi|4b76251c]-AdminTaskTimer) com.mchange.v2.async.ThreadPoolAsynchronousRunner: com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@2a94bd11 -- APPARENT DEADLOCK!!! Complete Status:
        Managed Threads: 3
        Active Threads: 3
        Active Tasks:
                com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@2ece5321
                        on thread: C3P0PooledConnectionPoolManager[identityToken->2v2d5k9y3ipope1s0apgi|4b76251c]-HelperThread-#2
                com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@736e6fcf
                        on thread: C3P0PooledConnectionPoolManager[identityToken->2v2d5k9y3ipope1s0apgi|4b76251c]-HelperThread-#1
                com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@5ceffb3c
                        on thread: C3P0PooledConnectionPoolManager[identityToken->2v2d5k9y3ipope1s0apgi|4b76251c]-HelperThread-#0
        Pending Tasks:
                com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@75425131
                com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@29c943e3
                com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@29d94102
                com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@a4c691e
                com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@6d606abf
                com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@ed5eaab
                com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@6de76b22
                com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@40aeb19
                com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@6a514cb5
                com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@4b7073e6
                com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@1d18afd1
                com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@4e19dd48
                com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@2ecd04da
                com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@666abda6
                com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@3ed4e09d
                com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@3ea78992
                com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@788aa148
                com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@4bbea472
                com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@52f76590
                com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@509e9d45
Pool thread stack traces:
        Thread[C3P0PooledConnectionPoolManager[identityToken->2v2d5k9y3ipope1s0apgi|4b76251c]-HelperThread-#2,5,main]
                java.net.PlainSocketImpl.socketConnect(Native Method)
                java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
                java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
                java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
                java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
                java.net.Socket.connect(Socket.java:589)
                java.net.Socket.connect(Socket.java:538)
                java.net.Socket.<init>(Socket.java:434)
                java.net.Socket.<init>(Socket.java:244)
                com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:243)
                com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:297)
                com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2232)
                com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265)
                com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)
                com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:790)
                com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)
                sun.reflect.GeneratedConstructorAccessor74.newInstance(Unknown Source)
                sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
                java.lang.reflect.Constructor.newInstance(Constructor.java:423)
                com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
                com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)
                com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325)
                com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175)
                com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220)
                com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206)
                com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203)
                com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138)
                com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125)

我的配置如下:

hibernate.connection.provider_class = "org.hibernate.c3p0.internal.C3P0ConnectionProvider";
hibernate.c3p0.min_size = "200";
hibernate.c3p0.max_size = "200";
hibernate.c3p0.idle_test_period = "100";
hibernate.c3p0.max_statements = "0";
hibernate.c3p0.timeout = "86400";
hibernate.c3p0.preferredTestQuery = "select 1";

你知道我为什么会这样吗。从我所读到的网络缓存是主要的罪魁祸首,导致这种情况发生打赌我没有缓存启用。

wpcxdonn

wpcxdonn1#

应用程序从数据库获取连接的尝试挂起,既没有成功,也没有异常失败。这些冻结的连接获取尝试正在耗尽线程池。您需要调试连接尝试挂起的原因。如今,这通常是由于管理云托管基础设施的安全/防火墙策略造成的。

相关问题