jedis
jedis copied to clipboard
What causes Jedis/Redis connection to be broken ?
Expected behavior
Write here what you're expecting We are not expecting this exception
Actual behavior
Write here what happens instead We are getting below exception trace
"redis.clients.jedis.exceptions.JedisConnectionException: Attempting to read from a broken connection" : [["Connection.java",314,"redis.clients.jedis.Connection.readProtocolWithCheckingBroken"], ["Connection.java",330,"redis.clients.jedis.Connection.getMany"], ["Pipeline.java",98,"redis.clients.jedis.Pipeline.sync"], ["JedisConnection.java",374,"org.springframework.data.redis.connection.jedis.JedisConnection.convertPipelineResults"], ["JedisConnection.java",363,"org.springframework.data.redis.connection.jedis.JedisConnection.closePipeline"], ["",-1,"sun.reflect.GeneratedMethodAccessor1408.invoke"], ["DelegatingMethodAccessorImpl.java",43,"sun.reflect.DelegatingMethodAccessorImpl.invoke"], ["Method.java",498,"java.lang.reflect.Method.invoke"], ["CloseSuppressingInvocationHandler.java",61,"org.springframework.data.redis.core.CloseSuppressingInvocationHandler.invoke"], ["",-1,"com.sun.proxy.$Proxy1319.closePipeline"]
Redis / Jedis Configuration
Jedis version: 3.1.0
Redis version: 5
Java version: 1.8
@geekthread It'll be required a lot more information. The key thing to find is whether pipeline alone is causing this issue. Because wrongful use of connection outside the pipeline may cause this. In that case, it should be resolved there.
If it's the pipeline itself, you may:
- decrease the pipeline size
- increase both Jedis socket timeout and Redis timeout
Alse you can check timeout in redis-server,config it 0
Closed due to inactivity.