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 connect failed when using dns resolver in jedis 5.1.2 #3871

Open
ellabider opened this issue Jun 23, 2024 · 5 comments
Open

Jedis connect failed when using dns resolver in jedis 5.1.2 #3871

ellabider opened this issue Jun 23, 2024 · 5 comments

Comments

@ellabider
Copy link

Expected behavior

connect success

Actual behavior

Write here what happens instead ...
redis.clients.jedis.exceptions.JedisConnectionException: Failed to connect to any host resolved for DNS name.
at redis.clients.jedis.DefaultJedisSocketFactory.connectToFirstSuccessfulHost(DefaultJedisSocketFactory.java:63) ~[jedis-5.1.2.jar:?]
at redis.clients.jedis.DefaultJedisSocketFactory.createSocket(DefaultJedisSocketFactory.java:89) ~[jedis-5.1.2.jar:?]
at redis.clients.jedis.Connection.connect(Connection.java:194) ~[jedis-5.1.2.jar:?]
at redis.clients.jedis.Connection.initializeFromClientConfig(Connection.java:392) ~[jedis-5.1.2.jar:?]
at redis.clients.jedis.Connection.(Connection.java:67) ~[jedis-5.1.2.jar:?]
at redis.clients.jedis.Jedis.(Jedis.java:220) ~[jedis-5.1.2.jar:?]
at redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:170) ~[jedis-5.1.2.jar:?]
at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:566) ~[commons-pool2-2.12.0.jar:2.12.0]
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:306) ~[commons-pool2-2.12.0.jar:2.12.0]
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:233) ~[commons-pool2-2.12.0.jar:2.12.0]
at redis.clients.jedis.util.Pool.getResource(Pool.java:38) ~[jedis-5.1.2.jar:?]
at redis.clients.jedis.JedisPool.getResource(JedisPool.java:378) ~[jedis-5.1.2.jar:?]

Steps to reproduce:

try(Jedis jedis = new Jedis("redis-host.mv.com", 6379)) {
System.out.println(jedis.ping()); // failed
}

most of time works as expected, but sometime randomly fails with a set of above failure with different redis endpoints

Redis / Jedis Configuration

using AWS EC2 resolver

Jedis version: 5.1.2

Redis version:7.2.4

Java version: openjdk version "21.0.2"

@katsanva
Copy link

katsanva commented Jun 25, 2024

Same for jedis 5.1.2, Redis 7.4.2, openjdk version "18.0.2.1" 2022-08-18

@sazzad16
Copy link
Collaborator

@ellabider @katsanva Was it fine with an earlier (but somewhat recent) version of Jedis?
What was the last Jedis version that works for you?

@katsanva
Copy link

@sazzad16 I've tried to upgrade from 3.10.0

@ngavrailov
Copy link

Same issue on our side. I tried with 5.1.3, then with 5.0.0 and still have it. Upgrade was from 4.3.2.

@ellabider
Copy link
Author

It occurred in 4.2.3 for sure. 3.8.0 - was OK, I think

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

4 participants