Issue Details (XML | Word | Printable)

Key: POOL-135
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Mark Thomas
Reporter: Mark Thomas
Votes: 0
Watchers: 0
Operations

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

_numActive > _maxActive under load

Created: 13/May/09 10:38 PM   Updated: 19/Jun/09 04:10 PM
Return to search
Component/s: None
Affects Version/s: 1.4
Fix Version/s: 1.5

Time Tracking:
Not Specified

Resolution Date: 13/May/09 10:48 PM


 Description  « Hide
Whilst investigating other POOL issues, I noticed that _numActive can be > _maxActive when under load. Test case and fix to follow.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #774574 Wed May 13 22:43:34 UTC 2009 markt Add test case for POOL-135. There is a timing element so this may not fail on all machines.
Files Changed
MODIFY /commons/proper/pool/trunk/src/test/org/apache/commons/pool/impl/TestGenericObjectPool.java

Repository Revision Date User Message
ASF #774576 Wed May 13 22:44:48 UTC 2009 markt Fix POOL-135 for GOP.
Files Changed
MODIFY /commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java

Repository Revision Date User Message
ASF #774579 Wed May 13 22:48:28 UTC 2009 markt Fix POOL-135 for GKOP.
Files Changed
MODIFY /commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java

Mark Thomas made changes - 13/May/09 10:48 PM
Field Original Value New Value
Resolution Fixed [ 1 ]
Fix Version/s 1.5 [ 12312915 ]
Status Open [ 1 ] Resolved [ 5 ]
Mark Thomas added a comment - 14/May/09 06:35 AM
The issue here is that addobjectToPool() returns an object to the pool and that another thread can borrow the newly returned object before _numActive is decremented. This can lead to _numActive > _maxActive although the real _numActive is <= _maxActive.

The fix ensures that when an object is returned to the pool, _numActive is decremented in the same sync block.


Repository Revision Date User Message
ASF #774668 Thu May 14 07:34:57 UTC 2009 markt Correct patch for POOL-135. Only decrement _numActive when flag is set
Files Changed
MODIFY /commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
MODIFY /commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java

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

Phil Steitz made changes - 19/Jun/09 04:10 PM
Status Resolved [ 5 ] Closed [ 6 ]