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

GenericObjectPool close and returnObject is not synchronized

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.3
    • Labels:
      None
    • Environment:

      ALL

      Description

      the javadoc on GenericObjectPool#close() says:
      "Closes the pool. Once the pool is closed, borrowObject() will fail with IllegalStateException, but returnObject(Object) and invalidateObject(Object) will continue to work, with returned objects destroyed on return.
      Destroys idle instances in the pool by invoking clear()."
      Thread1: pool.close()
      Thread2: pool.returnObject()
      since close and returnObject is not synchronized, there is a small chance that an returned object is not destoryed after the pool is closed

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              satiini yangxuesong
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: