我在我的系统中遇到了死锁,这里是相隔几分钟的 2 个 jstacks 的摘录
堆栈 1
Found one Java-level deadlock:
=============================
"com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2":
waiting to lock monitor 0x00007f1ad075d2e8 (object 0x00007f1aed690ff8, a com.mysql.jdbc.JDBC4ResultSet),
which is held by "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1"
"com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1":
waiting to lock monitor 0x00007f1ad075d390 (object 0x00007f1aed4ca6c8, a com.mysql.jdbc.JDBC4Connection),
which is held by "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2"
堆栈 2
Found one Java-level deadlock:
=============================
"com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2":
waiting to lock monitor 0x00007f1ad075d2e8 (object 0x00007f1aec62c8a8, a com.mysql.jdbc.JDBC4ResultSet),
which is held by "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1"
"com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1":
waiting to lock monitor 0x00007f1ad075d390 (object 0x00007f1aec6077b8, a com.mysql.jdbc.JDBC4Connection),
which is held by "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2"
在这两个 jstack 中,监视器 ID 相同 0x00007f1ad075d2e8和0x00007f1ad075d390,但对象 ID 不同。
明明是死锁,为什么对象id不一样?他们不应该一样吗?