Hello.
As I tested recent, Interrupting thread to Blocking socket with waiting for response is no effect.
Jedis blpop / brpop implementation uses infinite timeout, so we can meet this situation.
I think there're two ways of avoid it.
1. socket.close() releases this situation - equvalent statement for jedis is jedis.disconnect() or jedis.close()
But jedis instance is not thread-safe, and it could be broken when jedis.disconnect() is called.
So we should to discard jedis instance immediately. (If you're using pool, call JedisPool.returnBrokenResource())
2. specify short timeout for each blpop/brpop call, as you would to avoid.
Actually I think this is better solution, but solution 1 is not bad if you clean up perfectly.
Hope this helps.
Sincerely
Jungtaek Lim (HeartSaVioR)
2011년 7월 22일 금요일 오후 12시 46분 40초 UTC+9, T M 님의 말: