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

MariaDbPoolDataSource leaks connections when the mariadb server restarts

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.4, 2.7.3
    • Fix Version/s: 2.7.4, 3.0.1-beta
    • Component/s: pooling
    • Labels:
      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

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

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration