Issue Details (XML | Word | Printable)

Key: POOL-93
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Holger Hoffstätte
Votes: 2
Watchers: 4
Operations

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

Reduce contention by making borrow & return more independent from each other

Created: 24/Nov/06 03:23 PM   Updated: 10/Dec/07 02:56 AM
Return to search
Component/s: None
Affects Version/s: 1.1, 1.2, 1.3
Fix Version/s: 1.4

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works GenericObjectPool.patch 2007-04-23 01:37 PM Marcos Sanz 2 kB
Text File Licensed for inclusion in ASF works GKOP-relaxedSyncOnReturn.patch 2006-11-24 03:24 PM Holger Hoffstätte 4 kB
Text File Licensed for inclusion in ASF works perf-patch-GenericPool.txt 2007-04-23 01:37 PM Marcos Sanz 4 kB
Text File Licensed for inclusion in ASF works pool-93-markt-v2.patch 2007-12-09 11:35 PM Mark Thomas 27 kB
Text File Licensed for inclusion in ASF works relaxedReturnObjectBenchmark.txt 2006-11-24 04:12 PM Holger Hoffstätte 2 kB
Issue Links:
Blocker
 

Resolution Date: 10/Dec/07 02:56 AM


 Description  « Hide
Currently borrow & return are completely blocked from each other, while at least the factory-based validation & destruction can be handled independently. A few simple changes narrow the synchronization blocks yet retain overall correctness.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #602773 Mon Dec 10 02:53:10 UTC 2007 psteitz Reduced synchronization in GenericObjectPool, GenericKeyedObjectPool.
Factory method activations within synchronized blocks were causing
performance problems in DBCP and other applications where factory methods
could block.

JIRA: POOL-93
JIRA: POOL-108
Reported and patched by Holger Hoffstätte, Matthew Moore
Patched by Marcos Sanz, Mark Thomas
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
MODIFY /commons/proper/pool/trunk/xdocs/changes.xml

Repository Revision Date User Message
ASF #606295 Fri Dec 21 20:09:32 UTC 2007 psteitz Ensure that _numActive is always incremented *before* starting makeObject and
is decremented *after* destroyObject completes. Otherwise, while destroys
are in progress, makes may kick off, resulting in too many concurrent
instances. Test cases illustrate an unreported bug in pool 1.2,
which does not affect 1.3.
These changes should have been included in r602765.

JIRA: POOL-93
JIRA: POOL-108
Files Changed
MODIFY /commons/proper/pool/branches/1_4_RELEASE_BRANCH/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
MODIFY /commons/proper/pool/branches/1_4_RELEASE_BRANCH/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
MODIFY /commons/proper/pool/branches/1_4_RELEASE_BRANCH/src/test/org/apache/commons/pool/impl/TestGenericObjectPool.java
MODIFY /commons/proper/pool/branches/1_4_RELEASE_BRANCH/src/test/org/apache/commons/pool/impl/TestGenericKeyedObjectPool.java