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

Sporadic "Unknown reply: ?" exception on Jedis 4.X #3481

Closed
agavrilov76 opened this issue Jul 18, 2023 · 2 comments · Fixed by #3509
Closed

Sporadic "Unknown reply: ?" exception on Jedis 4.X #3481

agavrilov76 opened this issue Jul 18, 2023 · 2 comments · Fixed by #3509
Labels
Milestone

Comments

@agavrilov76
Copy link
Contributor

Expected behavior

No exception is thrown

Actual behavior

While running a massively parallelized workload on a fast modern machine, we have noticed a sporadic an connection exception coming from the Jedis initialization code since the migration to version 4.X:

redis.clients.jedis.exceptions.JedisConnectionException: Unknown reply: H
        at redis.clients.jedis@4.4.3/redis.clients.jedis.Protocol.process(Protocol.java:140)
        at redis.clients.jedis@4.4.3/redis.clients.jedis.Protocol.read(Protocol.java:192)
        at redis.clients.jedis@4.4.3/redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:335)
        at redis.clients.jedis@4.4.3/redis.clients.jedis.Connection.getMany(Connection.java:347)
        at redis.clients.jedis@4.4.3/redis.clients.jedis.Connection.initializeFromClientConfig(Connection.java:415)
        at redis.clients.jedis@4.4.3/redis.clients.jedis.Connection.<init>(Connection.java:61)
        at redis.clients.jedis@4.4.3/redis.clients.jedis.Jedis.<init>(Jedis.java:214)
        at redis.clients.jedis@4.4.3/redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:178)
        at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:571)
        at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:298)
        at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:223)
        at redis.clients.jedis@4.4.3/redis.clients.jedis.util.Pool.getResource(Pool.java:38)
        at redis.clients.jedis@4.4.3/redis.clients.jedis.JedisPool.getResource(JedisPool.java:378)
        at com.telenordigital.tdbase.redis@0.230714.0916/com.telenordigital.tdbase.redis.BaseJedisService.jedis(BaseJedisService.java:57)
        at com.telenordigital.tdbase.redis@0.230714.0916/com.telenordigital.tdbase.redis.BaseJedisService.withJedis(BaseJedisService.java:67)
        at com.telenordigital.tdbase.redis@0.230714.0916/com.telenordigital.tdbase.redis.BaseJedisService.<init>(BaseJedisService.java:48)
        at com.telenordigital.payment.dob.batch@1.0-SNAPSHOT/com.telenordigital.payment.dob.batch.BaseDobBatch.lambda$new$1(BaseDobBatch.java:41)
        at java.base/java.util.Optional.map(Optional.java:260)

This exception can indicate a corruption of the input connection stream, as if the number of read operations didn't match the number of writes. So maybe there is something wrong when Jedis sends two 'CLIENT SETINFO' commands in a pipeline expecting for two replies? I cannot quite see it by myself though.

Note that, when I re-run my workload with modified Jedis code without sending those client info commands everything works just fine, i.e. no exception is thrown.

Steps to reproduce:

Unfortunately, I haven't been able to come up with a reproducible test case yet

Redis / Jedis Configuration

a Redis server is running in a docker container on the local host

Jedis version:

4.4.3

Redis version:

7.0

Java version:

20

@agavrilov76
Copy link
Contributor Author

Would it be a good idea to add a mode to disable sending client information based on some sort of system property or a config parameter? I couldn't achieve it by overriding the 'pom.properties' resource file loaded by the JedisMetaInfo.class's classloader when the application is running with Java Modules

@sazzad16 sazzad16 added this to the 5.0.0 milestone Aug 17, 2023
@sazzad16 sazzad16 linked a pull request Aug 22, 2023 that will close this issue
@sazzad16 sazzad16 modified the milestones: 5.0.0, 5.1.0 Aug 22, 2023
@sazzad16 sazzad16 modified the milestones: 5.1.0, 5.0.1 Sep 19, 2023
@sazzad16 sazzad16 modified the milestones: 5.0.1, 4.4.x Dec 12, 2023
@sazzad16
Copy link
Collaborator

Released on Jedis versions 4.4.5 and 5.0.1

@sazzad16 sazzad16 modified the milestones: 4.4.x, 4.4.5 Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants