I don't understand why exactly, but testMaxActivePerKeyExceeded is now hanging regularly for me using 1.6.0_26 (Apple Lion). In the thread dump, I get the driving test thread:
"main" prio=5 tid=7feb5b001800 nid=0x1057f1000 waiting on condition [1057ee000] java.lang.Thread.State: TIMED_WAITING (sleeping) at java.lang.Thread.sleep(Native Method) at org.apache.commons.pool2.impl.TestGenericKeyedObjectPool.runTestThreads(TestGenericKeyedObjectPool.java:508) at org.apache.commons.pool2.impl.TestGenericKeyedObjectPool.testMaxActivePerKeyExceeded(TestGenericKeyedObjectPool.java:1274) And then all of the TestThreads waiting like this: "Thread-86" prio=5 tid=7feb5c95e000 nid=0x10dbdd000 waiting on condition [10dbdc000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <7f3038fd8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987) at org.apache.commons.pool2.impl.LinkedBlockingDeque.takeFirst(LinkedBlockingDeque.java:469) at org.apache.commons.pool2.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:757) at org.apache.commons.pool2.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:717) at org.apache.commons.pool2.impl.TestGenericKeyedObjectPool$TestThread.run(TestGenericKeyedObjectPool.java:1418) >From the line GKOP line number, you can see that what has happened is that all of the threads have hit the pool when it was exhausted, failed to create new instances and then gone fishing. I am not sure exactly how it is happening, but I suspect what is going on is that clearOldest is over-zealously killing idle instances before waiting threads can get to them. Phil --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org