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

Number of tested objects in eviction runs of GenericKeyedObjectPool

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5.1
    • Fix Version/s: 1.5.2
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      Hi,
      if numTestsPerEvictionRun is set to n and there are less than n idle objects in the pool, the evictor thread will still make n tests on these objects in a round-robin manner, i.e. idle objects can be tested more than once per eviction run. As this also includes validity tests if testWhileIdle is enbabled and validity tests may be time-consuming, this is a rather unwanted behavior.

      Instead of testing getNumTests() objects, the pool should test min(_pool.size(),getNumTests()) objects per eviction run.

      Thomas Schürger already reported this bug for GenericObjectPool (see POOL-6). I found out now, that this bug still exists for GenericKeyedObjectPool. Apparently, POOL-6 only solved the bug in GenericObjectPool.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                klaus.kopruch@materna.de Klaus Kopruch
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: