Uploaded image for project: 'Commons Pool'
  1. Commons Pool
  2. POOL-336

GenericObjectPool's borrowObject lock if create() fails with Error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.3, 2.5.0
    • 2.6.0
    • mariadb-connector-j

    Description

      We've spotted exactly the same problem as described in POOL-303 for a pool using mariadb-connector-j-2.1.2 with a pool configured to a size, which exactly reflects the normal quantity of used DB connections.
      After weeks of monitoring the situation, we were able to see the same problem as described in POOL-303. After some more drilldown efforts we concluded, that the problem is triggered, because mariadb-connector-j throws instances of Throwables derived from java.lang.Error, which are not instances of java.lang.Execption.
      This leads to a leak of makeCount in GenericObjectPool.create(), because makeCount is only decremented, when an instance of java.lang.Exception is thrown and not when an instance of java.langError is thrown.

      Attachments

        1. 0001-Add-a-test-case-for-POOL-336.patch
          4 kB
          Wolfgang Glas
        2. 0002-Fix-POOL-336.patch
          1.0 kB
          Wolfgang Glas

        Activity

          People

            Unassigned Unassigned
            wolfgang.glas@ev-i.at Wolfgang Glas
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: