With multiple waiting calls to BorrowObject, some will block forever if PassivateObject returns an error
dcormier opened this issue · comments
In some conditions, BorrowObject
will block forever even if all previous callers returned their objects to the pool.
Steps to reproduce:
- Configure that pool with a maximum limit of
1
(setMaxTotal = 1
) - Borrow the item from the pool
- Make two additional calls to
BorrowObject
- Return the borrowed item (from step 2) to the pool, causing
PassivateObject
to return an error - One of the additional calls to
BorrowObject
should have now gotten an object. Return it, causingPassivateObject
to fail again.
At this point, the third call to BorrowObject
will be blocked, even though the two prior calls to BorrowObject
both called ReturnObject
.
I have added a failing test showing this, here.
I'm looking into fixing this.