You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Mark Thomas (JIRA)" <ji...@apache.org> on 2016/11/02 21:01:58 UTC
[jira] [Resolved] (POOL-314) Return with testOnBorrow set
[ https://issues.apache.org/jira/browse/POOL-314?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Thomas resolved POOL-314.
------------------------------
Resolution: Duplicate
This is a variation on the problem described in POOL-310 and the fix for that issue fixes this one as well.
> Return with testOnBorrow set
> ----------------------------
>
> Key: POOL-314
> URL: https://issues.apache.org/jira/browse/POOL-314
> Project: Commons Pool
> Issue Type: Bug
> Affects Versions: 2.4.2
> Reporter: Tim Broberg
>
> On call to GenericKeyedObjectPool.returnObject() with testOnReturn set, when there are blocked GenericKeyedObjectPool.borrowObject() calls, I expect the blocked calls to unblock if returning this object successfully would free up a slot.
> Instead, returnObject() exits without checking for pending borrowObject()'s.
> This can result in a hung / timed out request despite the necessary resources to fill the request being available.
> if (getTestOnReturn()) {
> if (!factory.validateObject(key, p)) {
> // blah blah blah
> return;
> }
> }
> // blah blah blah
> if (hasBorrowWaiters()) {
> reuseCapacity(); // Never get here because we returned up above.
> }
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)