Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jedis connection exceptions #525

Open
sairamka opened this issue Nov 19, 2024 · 2 comments
Open

Jedis connection exceptions #525

sairamka opened this issue Nov 19, 2024 · 2 comments
Assignees

Comments

@sairamka
Copy link

sairamka commented Nov 19, 2024

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 bsbodden self-assigned this Nov 20, 2024
@bsbodden
Copy link
Contributor

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

@sairamka
Copy link
Author

sairamka commented Nov 20, 2024

Redis OM Spring v0.6.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants