Do not return Jedis conns to pool after NPE
DATAREDIS-153 - Return conn to pool as broken resource if NPE occurs (for example if a null key or value is given), preventing later flush of OutputStream with incomplete data - Workaround Jedis issue in pub/sub tests that prevents subscribing with a pooled connection - Continue not using pool in conn tests, as they are too brittle with potentially unclosed pipelines, unexecuted txs, etc
This commit is contained in:
@@ -162,6 +162,10 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
|
||||
protected DataAccessException convertJedisAccessException(Exception ex) {
|
||||
if(ex instanceof NullPointerException) {
|
||||
// An NPE before flush will leave data in the OutputStream of a pooled connection
|
||||
broken = true;
|
||||
}
|
||||
DataAccessException exception = JedisConverters.toDataAccessException(ex);
|
||||
if (exception instanceof RedisConnectionFailureException) {
|
||||
broken = true;
|
||||
|
||||
Reference in New Issue
Block a user