You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Pavel Kolesov (JIRA)" <ji...@apache.org> on 2018/04/18 09:04:00 UTC
[jira] [Updated] (POOL-340) borrowObject is stuck, if create fails
[ https://issues.apache.org/jira/browse/POOL-340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pavel Kolesov updated POOL-340:
-------------------------------
Description:
After changes in 2.4.3 there is a high chance of a scenario, in which borrowObject waits infinitely, if create fails or no one calls a create.
{noformat}
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000083cfd978> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at org.apache.commons.pool2.impl.LinkedBlockingDeque.takeFirst(LinkedBlockingDeque.java:583)
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:442)
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:363)
{noformat}
If pool is exhausted, when borrowObject tries to get idle object, it waits for new object to be created.
If all objects are returned to pool invalid and destroyed, and it is impossible to create a new one, borrowObject will not return.
Even if afterwards it is becomes possible to crate a new object but no one creates it, borrowObject will not return either.
was:
After changes in 2.4.3 there is a high chance of a scenario, in which borrowObject waits infinitely, if create fails or no one calls a create.
{noformat}
java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x0000000083cfd978> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039) at org.apache.commons.pool2.impl.LinkedBlockingDeque.takeFirst(LinkedBlockingDeque.java:583) at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:442) at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:363)
{noformat}
If pool is exhausted, when borrowObject tries to get idle object, it waits for new object to be created.
If all objects are returned to pool invalid and destroyed, and it is impossible to create a new one, borrowObject will not return.
Even if afterwards it is becomes possible to crate a new object but no one creates it, borrowObject will not return either.
> borrowObject is stuck, if create fails
> --------------------------------------
>
> Key: POOL-340
> URL: https://issues.apache.org/jira/browse/POOL-340
> Project: Commons Pool
> Issue Type: Bug
> Affects Versions: 2.4.3, 2.5.0
> Reporter: Pavel Kolesov
> Priority: Critical
>
> After changes in 2.4.3 there is a high chance of a scenario, in which borrowObject waits infinitely, if create fails or no one calls a create.
> {noformat}
> java.lang.Thread.State: WAITING (parking)
> at sun.misc.Unsafe.park(Native Method)
> - parking to wait for <0x0000000083cfd978> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
> at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
> at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
> at org.apache.commons.pool2.impl.LinkedBlockingDeque.takeFirst(LinkedBlockingDeque.java:583)
> at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:442)
> at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:363)
> {noformat}
> If pool is exhausted, when borrowObject tries to get idle object, it waits for new object to be created.
> If all objects are returned to pool invalid and destroyed, and it is impossible to create a new one, borrowObject will not return.
> Even if afterwards it is becomes possible to crate a new object but no one creates it, borrowObject will not return either.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)