Commons Pool
  1. Commons Pool
  2. POOL-152

GenericObjectPool hangs forever in borrowObject when newly created object is not validated

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.2, 1.5.3
    • Fix Version/s: 1.5.4
    • Labels:
      None

      Description

      If your set GenericObjectPool parameters such as: maxActive = 1 and whenExhaustedAction to block, testOnBorrow to true, call borrowObject that fails in validation of newly created object then second call of borrowObject will stuck.

      1. Test.java
        2 kB
        Bushov Alexander
      2. borrowObject.patch
        1.0 kB
        Bushov Alexander

        Activity

        Hide
        Mark Thomas added a comment -

        Thanks for the report. This has now been fixed in trunk.

        That patch wasn't quite right - allocate() still needs to be called since the internal processing count has changed and that may allow another object to be allocated. GenericKeyedObjectPool also needed a similar fix and I also added a test case.

        Show
        Mark Thomas added a comment - Thanks for the report. This has now been fixed in trunk. That patch wasn't quite right - allocate() still needs to be called since the internal processing count has changed and that may allow another object to be allocated. GenericKeyedObjectPool also needed a similar fix and I also added a test case.
        Hide
        Bushov Alexander added a comment -

        example and patch

        Show
        Bushov Alexander added a comment - example and patch

          People

          • Assignee:
            Unassigned
            Reporter:
            Bushov Alexander
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development