NoSuchElementException: Pool exhausted when starting app
See original GitHub issueBug Report
Current Behavior
Stack trace
Caused by: java.util.NoSuchElementException: Pool exhausted
at io.lettuce.core.support.BoundedAsyncPool.acquire()(Unknown Source)
Input Code
Input Code
client = RedisClient.create();
client.setOptions(
ClientOptions.builder()
.autoReconnect(true)
.cancelCommandsOnReconnectFailure(true)
.requestQueueSize(1024 * Runtime.getRuntime().availableProcessors())
.build());
final RedisURI redisURI = RedisURI.builder()
.withHost(redisAddr)
.withPort(6379) //默认值
.withPassword(redisPassword)
.build();
pool = AsyncConnectionPoolSupport.createBoundedObjectPool(
() -> client.connectAsync(StringCodec.UTF8, redisURI),
//默认8个连接
//refs:https://github.com/lettuce-io/lettuce-core/issues/1363
BoundedPoolConfig.builder()
.maxTotal(Runtime.getRuntime().availableProcessors() * 2)
.minIdle(Runtime.getRuntime().availableProcessors())
.build());
final String pong = pool.acquire().get().sync().ping();
Expected behavior/code
Environment
<lettuce.version>5.3.4.RELEASE</lettuce.version>
Possible Solution
Additional context
Issue Analytics
- State:
- Created 3 years ago
- Comments:21 (11 by maintainers)
Top Results From Across the Web
Connection pool gets exhausted, Not able to receive free ...
Check for code that doesn't close connection when exception is thrown. I would start with analysing queries running on mysql. If you have...
Read more >cannot get connection, pool exhausted - Oracle Communities
SQLNestedException: cannot get connection, pool exhausted. i have configured connection pooling in tomcat in the context.xml file.
Read more >"Timeout waiting for idle object" on large internal database
NoSuchElementException : "Timeout waiting for idle object" on large internal database ... /app/rest/builds REST API requests can lead to pool exhausted error.
Read more >Tuning Performance - MuleSoft Documentation
A Mule application is a collaboration of a set of flows. ... How long to wait in milliseconds when the pool exhausted action...
Read more >RE: [Commons DBCP] Cannot get a connection, pool exhausted ...
It's been a while since I've used hibernate but there is a start/end transaction aspect. If you start a transaction, and never end...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think I let that to @mp911de answer that but I put a random 10 😃
IIRC, I was increase the max pooled number, I have no access to the codes now. @vsharathis ,sorry。