Why design returnBrokenResource method?
I think this api is unnecessary,the code of redis operation in Jedis instance can catch exceptions,and mark the current Jedis instance must be destroied after return to pool,when developer call returnResource method,check the flag we mark before,decide whether or not destroy it.
@lianghaijian Hello. It's Apache commons pool's functionalities, so we expose it.
Btw, during supporting auto closeable Jedis, we already implemented your proposal. Please see https://github.com/xetorthio/jedis/pull/563 for details.
You can feel to return resource with force broken. In this situation, returnBrokenResource will help you. Please note that when you use try-with-resource you can't. (It returns same instance twice, and leads problems.) Hope this helps.
When you are sure with my comment, please close this issue. :)
Thinks.My jedis version is 2.4.2,i have tried the version 2.5.1,it solve my problem.