-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Milestone
Description
Expected behavior
I got the exception
redis.clients.jedis.exceptions.JedisExhaustedPoolException: Could not get a resource since the pool is exhausted
at redis.clients.jedis.util.Pool.getResource(Pool.java:53)
on first access to the pool using getResource. The underlying problem is missing access rights for the "PING" command, but JedisFactory swallos this error silently and turns it in a pool exhausted
Actual behavior
public boolean validateObject(PooledObject<Jedis> pooledJedis) {
BinaryJedis jedis = (BinaryJedis)pooledJedis.getObject();
try {
HostAndPort hostAndPort = (HostAndPort)this.hostAndPort.get();
String connectionHost = jedis.getClient().getHost();
int connectionPort = jedis.getClient().getPort();
return hostAndPort.getHost().equals(connectionHost) && hostAndPort.getPort() == connectionPort && jedis.isConnected() && jedis.ping().equals("PONG");
} catch (Exception var6) {
return false;
}
}
Jedis version:
3.3.0 + 3.4.0
Metadata
Metadata
Assignees
Labels
No labels