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

Could not get a resource from the pool and java.util.NoSuchElementException: Timeout waiting for idle object #1874

Closed
xiaoxianglee opened this issue Oct 8, 2018 · 2 comments

Comments

@xiaoxianglee
Copy link

Expected behavior

can get jedis with j3ds:2.9.0

Actual behavior

use try-with-close to get jedis instance by:
try (Jedis jedis = getJedisInstance()) {
bvalue = jedis.get(bkey);
} catch (Exception e) {
logger.warn("Exception *****", id, e);
}

but get exception in log:
redis.clients.jedis.exceptions.JedisException: Could not get a resource from the pool
at redis.clients.util.Pool.getResource(Pool.java:51) ~[jedis-2.9.0.jar:na]
at redis.clients.jedis.JedisPool.getResource(JedisPool.java:226) ~[jedis-2.9.0.jar:na]
......
Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:449) ~[commons-pool2-2.4.2.jar:2.4.2]
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:363) ~[commons-pool2-2.4.2.jar:2.4.2]
at redis.clients.util.Pool.getResource(Pool.java:49) ~[jedis-2.9.0.jar:na]
... 46 common frames omitted

Steps to reproduce:

Now can't reproduce it

Redis / Jedis Configuration

Jedis version:

2.9.0

Redis version:

4.0.8

Java version:

openjdk:17.0_45

@marcosnils
Copy link
Contributor

What's getJedisInstance doing?.

@sazzad16
Copy link
Collaborator

@xiaoxianglee The exception is thrown by commons-pool2-2.4.2 and there can be many reasons for that. It can even be due to some rare system issues. Without any specific reason and/or reproducing the issue, it can hardly be fixed.

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

3 participants