不知怎么突然 jedis 出现 “Could not get a resource from the pool”
错误,错误原因是连接池中的连接用尽
解决方法
1
2
3
4
5
6
7
8
redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
at redis.clients.util.Pool.getResource(Pool.java:22)
at com.derbysoft.jredis.longkeytest.BorrowObject.run(BorrowObject.java:22)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1134)
at redis.clients.util.Pool.getResource(Pool.java:20)
... 2 more