jconsole观察c3p0,发现不停地有阻塞

wangzhenhua 发布于 2013/12/20 13:33
阅读 1K+
收藏 0

c3p0有时候会报错,导致容器重新启动,服务挂掉。

使用jconsole进行监控,线程里面信息显示如下:

名称: C3P0PooledConnectionPoolManager[identityToken->1hgf4eq8z1z3fxm1jik78a|92992c]-HelperThread-#0

状态:TIMED_WAITING 在 com.mchange.v2.async.ThreadPoolAsynchronousRunner@1877fa7 上
阻塞总数:463,725  等待总数: 473,434

堆栈追踪: 
java.lang.Object.wait(Native Method)
com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:635)

谁知道为什么会不断地阻塞?这种情况正常么?

tomcat日志报错信息:

2013-12-11 09:23:07 [com.mchange.v2.async.ThreadPoolAsynchronousRunner]-[WARN] com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@177bb7a -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks!
2013-12-11 09:23:07 [com.mchange.v2.async.ThreadPoolAsynchronousRunner]-[WARN] com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@177bb7a -- APPARENT DEADLOCK!!! Complete Status: 
Managed Threads: 3
Active Threads: 3
Active Tasks: 
com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask@276565
on thread: C3P0PooledConnectionPoolManager[identityToken->1hgf4eq8y1jdz3or1h42r0d|13a6057]-HelperThread-#1
com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask@71fc3b
on thread: C3P0PooledConnectionPoolManager[identityToken->1hgf4eq8y1jdz3or1h42r0d|13a6057]-HelperThread-#2
com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask@16689d1
on thread: C3P0PooledConnectionPoolManager[identityToken->1hgf4eq8y1jdz3or1h42r0d|13a6057]-HelperThread-#0
Pending Tasks: 
com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask@e23387


以下是问题补充:

@wangzhenhua:补充说明一下:c3p0的版本使用的是c3p0-0.9.2.1 (2013/12/20 13:34)
加载中
0
duty
duty
APPARENT DEADLOCK!!!  死锁. 看看死锁锁哪里了
w
wangzhenhua
现象是死锁,其实数据库没死锁,线程池死锁,还有jconsole监控的数据,c3p0连接池的问题么?
duty
duty
@177bb7a 看看这个地址被谁拿着呢
0
宅男小何
宅男小何
典型的死锁
0
夜萤
这个改个配置就好了
返回顶部
顶部