Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-864

includeThreadDumpInDeadlockExceptions always includes the thread dump, even when it is not a deadlock exception

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7.2
    • Fix Version/s: 3.0.0, 2.7.3
    • Component/s: Other
    • Labels:
      None

      Description

      When the option includeThreadDumpInDeadlockExceptions is set to true, any SQL exception causes a thread dump to be added to the exception message.

      org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.buildMsgText(String, long, Options, Exception) does this:

      if (options != null
              && options.includeInnodbStatusInDeadlockExceptions
              && deadLockException != null) {
            msg.append("\ndeadlock information: ").append(deadLockException);
      }
       
      if (options != null && options.includeThreadDumpInDeadlockExceptions) {
        // append thread dump
      }
      

      I'm not confident with this code, but I suspect that the second block should also be executed only if deadLockException != null.

        Attachments

          Activity

            People

            Assignee:
            diego dupin Diego Dupin
            Reporter:
            mauromol Mauro Molinari
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration