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

MariaDbPoolDataSource leaks connections when the mariadb server restarts

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 2.4.4, 2.7.3
    • 2.7.4, 3.0.1-beta
    • pooling
    • None

    Description

      When an active MariaDbConnection fails (e.g. mariadb server restarts), the MariaDbPoolDataSource does not decrement Pool.totalConnection.
      Consequently Pool.getConnection() may fail thinking the pool is full.

      I test with the MariaDB Connector/J versions 2.4.4 and 2.7.3
      The error is slightly different between these two versions but the behavior is the same.

      2.4.4: When the connection fails, executeQuery calls fireConnectionErrorOccured.
      Unfortunately the connectionErrorOccurred decrements Pool.totalConnection only if the connection is already in the idleConnections queue

      2.7.3: MariaDbConnection.close() tries to rollback the transaction but it fails and throws an exception.
      The connectionErrorOccurred method is never called.

      See MariaDbPoolDataSourceTest.java and output_***.txt to reproduce the issue.

      Thank you

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            Antonin Cart Antonin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.