issue with jedis 5.1.0

37 views
Skip to first unread message

Training By Coding

unread,
Feb 25, 2024, 6:47:50 AMFeb 25
to Redis DB
Hi,
Anyone can please help me out!!!
My code works fine with Jedis 2.10.0. Issue started when upgraded the jedis to 4.4.6 or 5.1.0
Issue highlighted on on Jedis community but no response. https://github.com/redis/jedis/issues/3723

Error message
`ERROR 19128 --- [ns-pool-evictor] redis.clients.jedis.JedisFactory : Error while validating pooled Jedis object.

redis.clients.jedis.exceptions.JedisConnectionException: Unexpected end of stream.
at redis.clients.jedis.util.RedisInputStream.ensureFill(RedisInputStream.java:248) ~[jedis-5.1.0.jar:na]
at redis.clients.jedis.util.RedisInputStream.readByte(RedisInputStream.java:47) ~[jedis-5.1.0.jar:na]
at redis.clients.jedis.Protocol.process(Protocol.java:135) ~[jedis-5.1.0.jar:na]
at redis.clients.jedis.Protocol.read(Protocol.java:221) ~[jedis-5.1.0.jar:na]
at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:350) ~[jedis-5.1.0.jar:na]
at redis.clients.jedis.Connection.getStatusCodeReply(Connection.java:268) ~[jedis-5.1.0.jar:na]
at redis.clients.jedis.Jedis.ping(Jedis.java:339) ~[jedis-5.1.0.jar:na]
at redis.clients.jedis.JedisFactory.validateObject(JedisFactory.java:198) ~[jedis-5.1.0.jar:na]
at org.apache.commons.pool2.impl.GenericObjectPool.evict(GenericObjectPool.java:748) ~[commons-pool2-2.12.0.jar:2.12.0]
at org.apache.commons.pool2.impl.BaseGenericObjectPool$Evictor.run(BaseGenericObjectPool.java:162) ~[commons-pool2-2.12.0.jar:2.12.0]
at org.apache.commons.pool2.impl.EvictionTimer$WeakRunner.run(EvictionTimer.java:115) ~[commons-pool2-2.12.0.jar:2.12.0]
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[na:na]
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[na:na]
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]


Jedis configuration in code:

private JedisPoolConfig buildPoolConfig() {
final JedisPoolConfig poolConfig = new JedisPoolConfig();
poolConfig.setMaxTotal(500);
poolConfig.setMaxIdle(500);
poolConfig.setMinIdle(100);
poolConfig.setTestOnBorrow(false);
poolConfig.setTestOnReturn(false);
poolConfig.setTestWhileIdle(false);
poolConfig.setMaxWait(Duration.ofSeconds(60));
poolConfig.setSoftMinEvictableIdleDuration(Duration.ofSeconds(60)); 
poolConfig.setMinEvictableIdleDuration(Duration.ofSeconds(60));
poolConfig.setTimeBetweenEvictionRuns(Duration.ofSeconds(5));  
poolConfig.setBlockWhenExhausted(true); 
return poolConfig;
}

code where connection pool used

@Autowired @Qualifier("jedistestpool") JedisPool testPool; @Retryable(value = {Exception.class}, maxAttempts = 3, backoff = @Backoff(delay = 30000)) public void setExpire(List<Map<byte[], Map<byte[], byte[]>>> list, int timeout, String cache) { JedisPool jedisPool = null; Jedis jedis = null; try { switch (cache) { case Constants.TEST: jedisPool = testPool; break; } **jedis = jedisPool.getResource(); /// i am getting error from here** Pipeline pipelined = jedis.pipelined(); Iterator<Map<byte[], Map<byte[], byte[]>>> iterator = list.iterator(); while (iterator.hasNext()) { Map<byte[], Map<byte[], byte[]>> region = iterator.next(); for (Map.Entry<byte[], Map<byte[], byte[]>> entry : region.entrySet()) { pipelined.expire(entry.getKey(), (int) timeout); } } pipelined.sync(); } catch (Exception e) { throw e; }
Reply all
Reply to author
Forward
0 new messages