redis / redis-om-spring

Spring Data Redis extensions for better search, documents models, and more
MIT License
609 stars 94 forks source link

Jedis connection exceptions #525

Open sairamka opened 1 week ago

sairamka commented 1 week ago

We are frequently getting these Jedis connection exceptions, while we filtering with SearchStream

exception #1 redis.clients.jedis.exceptions.JedisConnectionException: Unexpected end of stream. at redis.clients.jedis.util.RedisInputStream.ensureFill(RedisInputStream.java:202) ~[jedis-3.8.0.jar!/:na] at redis.clients.jedis.util.RedisInputStream.readByte(RedisInputStream.java:43) ~[jedis-3.8.0.jar!/:na] at redis.clients.jedis.Protocol.process(Protocol.java:165) ~[jedis-3.8.0.jar!/:na] at redis.clients.jedis.Protocol.read(Protocol.java:230) ~[jedis-3.8.0.jar!/:na]

exception #2 java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class [B (java.util.ArrayList and [B are in module java.base of loader 'bootstrap') at redis.clients.jedis.Connection.getStatusCodeReply(Connection.java:270) ~[jedis-3.8.0.jar!/:na] at redis.clients.jedis.BinaryJedis.set(BinaryJedis.java:426) ~[jedis-3.8.0.jar!/:na] at org.springframework.data.redis.connection.jedis.JedisInvoker.lambda$from$20(JedisInvoker.java:299) ~[spring-data-redis-2.7.18.jar!/:2.7.18]

this is the JedisConnectionFactory that we are supplying for om framework.

@Bean public JedisConnectionFactory jedisConnectionFactory() {

    RedisStandaloneConfiguration conf = new RedisStandaloneConfiguration(redisHost, redisPort);

    final JedisPoolConfig poolConfig = new JedisPoolConfig();
    poolConfig.setMinEvictableIdleTime(Duration.ofSeconds(60));
    poolConfig.setTimeBetweenEvictionRuns(Duration.ofSeconds(30));
    poolConfig.setNumTestsPerEvictionRun(-1);
    poolConfig.setMaxTotal(-1);
    poolConfig.setMaxIdle(100);
    poolConfig.setMinIdle(1);
    poolConfig.setBlockWhenExhausted(false);
    final JedisClientConfiguration jedisClientConfiguration = JedisClientConfiguration.builder()
            .connectTimeout(Duration.ofSeconds(30)).readTimeout(Duration.ofSeconds(30)).usePooling()
            .poolConfig(poolConfig).build();
    return new JedisConnectionFactory(conf, jedisClientConfiguration);
}

Redis / Jedis Configuration

Jedis version: 3.8.0

Redis version: 6.2.12

Java version: 11

bsbodden commented 6 days ago

@sairamka What version of Redis OM Spring are you using?

sairamka commented 6 days ago

Redis OM Spring v0.6.4