Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-15731

Investigate issues with MySQL database connections involving autoReconnect=true



    • Suggestion
    • Resolution: Fixed
    • None
    • None
    • JIRA 3.13, MySQL Database
    • We collect Jira feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.


      Since 3.13 we have seen an increase in cases with the following error message:

      The last packet sent successfully to the server was XXXXX seconds ago, which is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.

      In each case the autoReconnect parameter has been set to true, as per the documentation

      Note that the MySQL documentation discourage using the autoReconnect parameter

      The use of this feature is not recommended, because it has side effects related to session state and data consistency when applications don't handle SQLExceptions properly, and is only designed to be used when you are unable to configure your application to handle SQLExceptions resulting from dead and stale connections properly. Alternatively, investigate setting the MySQL server variable "wait_timeout" to some high value rather than the default of 8 hours.

      Need to investigate the possible cause of the problems and potential workarounds / fixes.

      Summary of Findings:

      • The MySQL "autoReconnect" parameter is useless and can be removed
      • The best (simplest) way to make JIRA able to survive MySQL connection timeouts is to set the validationQuery parameter.
        See Surviving Connection Closures for details.
      • The reason that JIRA used to survive these closures prior to v3.13, was that the DB pool we used was accidentally resetting closed connections.




            mlassau Mark Lassau (Inactive)
            andrew.myers Andrew Myers [Atlassian]
            0 Vote for this issue
            15 Start watching this issue