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

Thread Interrupt during borrowObject may lock pool

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 1.5.4
    • 1.5.5
    • None
    • The pool is being used for a connection pool of SSH connections on slax.

    Description

      We're using the pool quite intensively, with many borrow and return calls. The pool is set to WHEN_EXHAUSTED_BLOCK with a positive wait value (a few seconds). Sometimes, the thread that is waiting on the "latch.wait(waitTime)" call (Line 1112 in GenericObjectPool of version 1.5.4) may be interrupted. When that happens, the InterruptedException will be caught and rethrown correctly. However, after this happens, the pool becomes useless and no borrowObject calls succeed.

      By looking at the code, it appears that some cleanup that is done in normal operation (right before the NoSuchElementException timeout exception is thrown) is not done in the case detailed above. It is possible that the cleanup should be done in the case of interruption as well, to ensure the pool continues to operate correctly.

      Attachments

        Activity

          People

            Unassigned Unassigned
            yonadav YL
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: