commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Broberg (JIRA)" <>
Subject [jira] [Created] (POOL-314) Return with testOnBorrow set
Date Sun, 16 Oct 2016 07:48:20 GMT
Tim Broberg created POOL-314:

             Summary: Return with testOnBorrow set
                 Key: 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

        // blah blah blah
        if (hasBorrowWaiters()) {
            reuseCapacity(); // Never get here because we returned up above.

This message was sent by Atlassian JIRA

View raw message