commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Struberg (JIRA)" <>
Subject [jira] [Commented] (POOL-340) borrowObject is stuck, if create fails
Date Fri, 26 Oct 2018 22:15:00 GMT


Mark Struberg commented on POOL-340:

I'm not quite sure I follow the unit test.
In SingleObjectFactory#validatePbject() you only return true once. Every subsequent validation
is false.
And of course when returning the object to the pool will then say nay. Even if it is perfectly
If we created the PooledObject then it is valid imo. Bc the test doesn't allow to create 2
instances anyway.
Returning true in validateObject lets the test pass with the latest codebase.

> borrowObject is stuck, if create fails
> --------------------------------------
>                 Key: POOL-340
>                 URL:
>             Project: Commons Pool
>          Issue Type: Bug
>    Affects Versions: 2.4, 2.4.1, 2.4.2, 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(
>         at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(
>         at org.apache.commons.pool2.impl.LinkedBlockingDeque.takeFirst(
>         at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(
>         at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(
> {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

View raw message