Jedis errors

https://github.com/xetorthio/jedis

Jedis is a blazingly small and sane Redis java client

Documented:

Top patterns

  1. Read responded with an error code that is not handled by Jedis
    No solution
  2. End of stream while reading Redis response

    There are multiple things to check when you have Jedis connection issues. A handful of tips are discussed in this GitHub issue:

    • call close() to return the Jedis instance to the pool (do not call returnResource())
    • catch JedisConnectionException for each Jedis command, and retrieve a new Jedis instance from the pool for the next Jedis commands to work (in the catch clause)
    • Change the timeout (in JedisPool constructor), because in my case, I retrieve a new Jedis instance at the beginning of the request and I return it at the end of the request. Because a request may last more than 2 seconds (not optimized code yet), the timeout needed to be greater
    • Change the pool max clients, but it must be lower than the redis maxclients in redis configuration
    • Change the pool max idle clients
    • Set testOnBorrow, testOnReturn and testWhildIdle to true for the JedisPool so that the connection to redis is validated often enough to avoid connection issues (all of these test methods may not be necessary but I used all of them and it works)
  3. Unable to connect Redis
    No solution

DescriptionException TypeEntry MethodWeb pages
JedisConnectionExceptionJedis.set1
JedisMovedDataExceptionJedis.set1
Package namePatterns foundSolution coverageDescription coverage
redis.clients.jedis128
redis.clients.util22
Package nameClass namePatterns foundSolution coverageDescription coverage
redis.clients.jedisConnection43
redis.clients.jedisProtocol16
redis.clients.jedisBinaryJedis15
redis.clients.jedisBinaryClient12
redis.clients.jedisJedisPool9
redis.clients.jedisJedis9
redis.clients.jedisJedisClusterCommand5
redis.clients.jedisPipeline4
redis.clients.jedisResponse3
redis.clients.jedisJedisCluster3
redis.clients.jedisBuilderFactory$52
redis.clients.jedisJedisSentinelPool2
redis.clients.jedisJedisSlotBasedConnectionHandler1
redis.clients.jedisJedisPubSub1
redis.clients.jedisBinaryJedisCluster1
redis.clients.jedisJedisFactory1
redis.clients.jedisHostAndPort1
Package nameClass nameMethod namePatterns foundSolution coverage
redis.clients.jedisJedissubscribe2
redis.clients.jedisJedisset2
redis.clients.jedisJediseval2
redis.clients.jedisJedissort1
redis.clients.jedisJedisconfigSet1
redis.clients.jedisJedisclose1
Package nameClass nameMethod nameException TypePatterns foundSolution coverage
redis.clients.jedisJedissetJedisConnectionException1
redis.clients.jedisJedissetJedisMovedDataException1