jedis icon indicating copy to clipboard operation
jedis copied to clipboard

What causes Jedis/Redis connection to be broken ?

Open geekthread opened this issue 3 years ago • 2 comments

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 avatar Sep 08 '21 04:09 geekthread

@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:

  1. decrease the pipeline size
  2. increase both Jedis socket timeout and Redis timeout

sazzad16 avatar Sep 08 '21 06:09 sazzad16

Alse you can check timeout in redis-server,config it 0

zeekling avatar Dec 20 '21 16:12 zeekling

Closed due to inactivity.

sazzad16 avatar Sep 09 '22 09:09 sazzad16