Issue Details (XML | Word | Printable)

Key: POOL-144
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Phil Steitz
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Pool

Maxwait exceeded causes pool capacity leak

Created: 12/Jun/09 11:03 PM   Updated: 19/Jun/09 04:06 PM
Return to search
Component/s: None
Affects Version/s: 1.5
Fix Version/s: 1.5.1

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works latch_leak.patch 2009-06-12 11:04 PM Phil Steitz 2 kB

Resolution Date: 13/Jun/09 05:43 PM


 Description  « Hide
When exhausted action is set to WHEN_EXHAUSTED_BLOCK, maxwait is positive and client threads time out waiting for idle objects, capacity can be "leaked" from GenericObjectPools and GeneritCkeyedObjectPools.

Test case and patch for GOP attached.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Phil Steitz added a comment - 13/Jun/09 01:27 AM
Looking at the patch again and the same pattern in case WHEN_EXHAUSTED_FAIL, I am concerned that while the exception-generating thread waits to acquires the lock on the pool to remove the latch, another thread could sneak in and do something (e.g. return and object) that triggers an allocate, which will leak an object onto the soon-to-be-abandoned latch.

Mark Thomas added a comment - 13/Jun/09 05:37 PM
I agree with your analysis. I'd also add that similar problems can occur in each of the case statements. When a thread enters a sync block, there needs to be a check that another thread hasn't allocated an object whilst the current thread was waiting for a lock.

I have a patch for GOP and GKOP. I'll commit it shortly.


Mark Thomas added a comment - 13/Jun/09 05:43 PM
Fixed in trunk. Thanks for catching this.

Phil Steitz added a comment - 19/Jun/09 04:06 PM
Fixed in 1.5.1 release.