We use the Hibernate and c3p0 pooling library. Until now, this combination worked perfectly until recently, when we decided to increase maxPoolSize to 1000 and conduct a lot of stress testing of our application. The peak load of our application leads to the fact that the database responds very slowly, and, as a result, the c3p0 deadlock detector spits out the APPARENT DEADLOCK warning again and again.
Based on the c3p0 documentation, we changed maxAdministrativeTaskTime to 10 minutes, assuming Deadlock is detected once every 30 minutes (the code indicates that the deadlock detection rate is three times higher than maxAdministrativeTaskTime).
However, when analyzing c3p0 logs, the deadlock detection thread runs more than 30 minutes. The relevant part of the magazines is attached. Surprisingly, the frequency is uneven.
Line 573745: [Timer-2] 2013-06-26 04:47:52,492 WARN [null] com .mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@ 662cee3b -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks! Line 573746: [Timer-2] 2013-06-26 04:47:52,512 WARN [null] com .mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@ 662cee3b -- APPARENT DEADLOCK!!! Complete Status: Line 574292: [Timer-2] 2013-06-26 04:49:12,493 WARN [null] com .mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@ 662cee3b -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks! Line 574293: [Timer-2] 2013-06-26 04:49:12,513 WARN [null] com .mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@ 662cee3b -- APPARENT DEADLOCK!!! Complete Status: Line 575004: [Timer-2] 2013-06-26 04:50:32,494 WARN [null] com .mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@ 662cee3b -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks! Line 575005: [Timer-2] 2013-06-26 04:50:32,511 WARN [null] com .mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@ 662cee3b -- APPARENT DEADLOCK!!! Complete Status: Line 576062: [Timer-2] 2013-06-26 04:51:52,495 WARN [null] com .mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@ 662cee3b -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks! Line 576063: [Timer-2] 2013-06-26 04:51:52,536 WARN [null] com .mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@ 662cee3b -- APPARENT DEADLOCK!!! Complete Status: Line 576720: [Timer-2] 2013-06-26 04:53:12,496 WARN [null] com .mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@ 662cee3b -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks! Line 576721: [Timer-2] 2013-06-26 04:53:12,516 WARN [null] com .mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@ 662cee3b -- APPARENT DEADLOCK!!! Complete Status: Line 594087: [Timer-2] 2013-06-26 04:55:52,550 WARN [null] com .mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@ 662cee3b -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks! Line 594088: [Timer-2] 2013-06-26 04:55:52,569 WARN [null] com .mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@ 662cee3b -- APPARENT DEADLOCK!!! Complete Status: Line 594753: [Timer-2] 2013-06-26 04:57:12,550 WARN [null] com .mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@ 662cee3b -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks! Line 594754: [Timer-2] 2013-06-26 04:57:12,572 WARN [null] com .mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@ 662cee3b -- APPARENT DEADLOCK!!! Complete Status: Line 595624: [Timer-2] 2013-06-26 04:58:32,552 WARN [null] com .mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@ 662cee3b -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks! Line 595625: [Timer-2] 2013-06-26 04:58:32,570 WARN [null] com .mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@ 662cee3b -- APPARENT DEADLOCK!!! Complete Status: Line 596416: [Timer-2] 2013-06-26 04:59:52,552 WARN [null] com .mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@ 662cee3b -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks! Line 596417: [Timer-2] 2013-06-26 04:59:52,572 WARN [null] com .mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@ 662cee3b -- APPARENT DEADLOCK!!! Complete Status: Line 611011: [Timer-2] 2013-06-26 05:02:22,556 WARN [null] com .mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@ 662cee3b -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks! Line 611012: [Timer-2] 2013-06-26 05:02:22,577 WARN [null] com .mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@ 662cee3b -- APPARENT DEADLOCK!!! Complete Status:
Can someone explain this anomaly?