Tim Broberg created POOL-314:

             Summary: 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 

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

Reply via email to