Uploaded image for project: 'JIRA Server (including JIRA Core)'
  1. JIRA Server (including JIRA Core)
  2. JRASERVER-15731

Investigate issues with MySQL database connections involving autoReconnect=true


    • Type: Suggestion
    • Status: Resolved (View Workflow)
    • Resolution: Fixed
    • Affects Version/s: 3.13
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:
      JIRA 3.13, MySQL Database
    • Feedback Policy:
      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 An updated workflow for server feature suggestions.


      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.




            • Assignee:
              mlassau Mark Lassau (Inactive)
              andrew.myers Andrew Myers [Atlassian]
            • Votes:
              0 Vote for this issue
              11 Start watching this issue


              • Created: