Bug #64961 includeThreadDumpInDeadlockExceptions includes thread dump for non-deadlocks
Submitted: 12 Apr 2012 20:47 Modified: 5 Nov 2022 1:50
Reporter: Archie Cobbs Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:5.1.18, 5.1.20 OS:Linux
Assigned to: Assigned Account CPU Architecture:Any
Tags: includeThreadDumpInDeadlockExceptions

[12 Apr 2012 20:47] Archie Cobbs
Description:
The "includeThreadDumpInDeadlockExceptions" option seems to cause a thread dump to be inclued for ALL exceptions, not just deadlock exceptions.

For example:

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'globals' already exists

*** Java threads running at time of deadlock ***

"pool-12-thread-1" tid=143 TIMED_WAITING on lock=java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@4e484f2d in sun.misc.Unsafe.park()
        at sun.misc.Unsafe.park(Native Method)
        at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:196)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2025)
....

How to repeat:
Connect via JDBC with includeThreadDumpInDeadlockExceptions=true configured and execute a SQL statement that has a syntax error.

Note the entire JVM thread state is dumped to the console, even though there was no deadlock.
[1 Jun 2012 17:22] Sveta Smirnova
Thank you for the report.

Verified as described.

Although more debugging information is better than less =)