|
[
Permlink
| « Hide
]
Phil Steitz added a comment - 29/Jun/09 11:46 PM
Can you be more specific on the "weird behavior" you are observing?
sure,
I am using it as a Socket pool with the KeyedPoolableObjectFactory as a socketFactory which returns a socket for each makeObject() call The Test scenario which causes issue is this: Common-Pools-1.5.1 : both A and B start throwing NoSuchElementException I am trying to write a test case for the same will attach it once m done. Best Correction : A is slow in freeing up resource where B is fast (not vice-versa as mentioned last time)
Am I correct in thinking that your have a single pool of sockets that clients use to connect to either Server A or Server B?
Yes...
they share the same socket pool (GenericKeyedObjectPool) keyed on nodeId for server A /B. my understanding is threads blocked on Key A (slow server) should not cause thread blocking for Key B ?? Is this assumption correct. OK, now I understand.
That is a bug although making the Latch object global is not the way to address this. I have added a test case and am working on a patch. This has now been fixed. Many thanks for the report.
Many Thanks Mark,
Can you attach the patch to this bug ?? I would like to see the fix I spent considerable time looking into the commons-pools code base and couldn't find the issue and yes global Latch was not a solution I understood after looking into the code later. BTW have you looked into ArrayBlockingQueue from java 1.5.0 onwards in their concurrent package ?? I was thinking using that would clean up the code a lot ? Use the "Subversion commits" tab to see the changes related to this bug.
Utilising JDK 1.5 features is one of the considerations for the Pool 2.x series. There was a thread on the commons dev list about this not that long ago. Regarding ArrayBlockingQueue there is always backport-util-concurrent, seems like a logical step to me if 1.4 compatibility is desired..
|
||||||||||||||||||||||||||||||||||||||||||||||||||