Upgrade to Spring Data Redis 3 and Jedis 4.3.2 throws JedisCluerOperationException

957 views
Skip to first unread message

Raul Muresan

unread,
May 10, 2023, 7:57:28 AM5/10/23
to Jedis
Hello,
I stumbled upon your group in the jedis git repository, I am facing a blocker and don’t know how to get over it.

Here is a link to the stackoverflow question that I created: https://stackoverflow.com/questions/76207822/updating-to-spring-boot-3-0-6-jedis-fails-unit-tests-with-jedisclusteroperatio

In short lines, the issue is that since I updated my java app to spring boot 3 (spring-data-redis included) and jedis 4.3.2 all unit tests that use jedis fail with:
redis.clients.jedis.exceptions.JedisClusterOperationException: Could not initialize cluster slots cache.
Debugging JedisConnectionException resulted to: "Failed to connect to any host resolved for DNS name."

I really hope that you can give me a couple of hints on where to investigate further or maybe something that I am missing.

Sazzadul Hoque

unread,
May 11, 2023, 12:07:05 PM5/11/23
to jedis...@googlegroups.com
GitHub link of same content: https://github.com/redis/jedis/issues/3392 

Copying my (first) reply:

I wonder what is in your unit tests. Could it be just limited to creating a cluster connection object? Without executing any other command?

Why I'm wondering this is because of a certain difference between Jedis 3.x and Jedis 4+ which seems to matter in your case.
In Jedis 3.x, when a JedisCluster object was being created with all cluster nodes down/unavailable, the constructor would not throw any exception and the object would be created BUT it would be a stale object with which no server operations can be done.
To address requests from users, Jedis 4.0 started throwing exceptions in such cases with message `Could not initialize cluster slots cache.`.

I hope I have been able to identify your problem properly and you have found it helpful. Thanks.

--
You received this message because you are subscribed to the Google Groups "Jedis" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jedis_redis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jedis_redis/39726b0f-260b-4bba-9bc3-d3c4e062f903n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages