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:
Jennifer Hickey
2013-08-21 11:07:28 -07:00
parent e1f54d6c68
commit b106f03bd7
3 changed files with 148 additions and 7 deletions

View File

@@ -4,13 +4,8 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<!-- DATAREDIS-153 We can't pool connections for this test because Jedis
leaves OutputSteam in compromised state on NullPointerException (which happens
if a null key or value is used) but doesn't remove them from the pool or
reconnect them on next attempted use -->
<bean id="jedisConnectionFactory "
class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
p:usePool="false" p:timeout="60000">
<bean id="jedisConnectionFactory"
class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory" p:timeout="60000" p:usePool="false">
<property name="hostName">
<bean class="org.springframework.data.redis.SettingsUtils"
factory-method="getHost" />