psteitz commented on PR #230:
URL: https://github.com/apache/commons-pool/pull/230#issuecomment-1646992200

   I looked at the test case.  I would expect to see the test threads getting a 
lot of IllegalStateExceptions due to what amounts to a misuse of the API.  We 
should probably clarify that invalidating an object after you have returned it 
to the pool (or doing anything else with it) violates the pool contract.  The 
borrow - invalidate sequence in the test could be intermediated by a borrow by 
another thread.  That will cause ISE when the other thread returns it if that 
happens after the invalidate's destroy completes.  The invalidates will throw 
ISE if another thread has destroyed the instance (which the test setup allows). 
 All of this is to say, you can't do what the test is doing.  Does the Jedis 
code do this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to