-
Notifications
You must be signed in to change notification settings - Fork 1k
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
NoSuchElementException: Pool exhausted when starting app #1423
Comments
Isn't this fixed in refs:#1363 |
I also think that's a duplicate of #1363. By awaiting initialization via |
@mp911de Yes, I was using the 5.3.4, so I was wondering... |
#1363 introduced two new methods |
@mp911de I will read through the PR and feedback. |
|
Thanks for report. We need to check why this is. |
@mp911de After I set the maxTotal to match the concurrent acquire threads number, it disappears. |
Providing a minimal sample that reproduces the problem would be helpful. Since I don't have any insight into what the application is doing it's not possible to further diagnose the issue. |
@mp911de I will close this one, cause it's turn out to be an underside issue. thanks. |
@He-Pin , I encountered same issue, can you please share the code snippet to mitigate the issue ? |
Hi @vsharathis, I do not know if this is the correct way of doing stuff (@mp911de could validate) but to avoid that error, it seems you need to prepare your async pool like that: public AsyncPool<StatefulRedisConnection<String, String>> createAsyncConnectionPool(RedisURI redisURI, int connectionPoolSize) {
var boundedPoolConfig = BoundedPoolConfig.builder()
.minIdle(connectionPoolSize)
.maxTotal(connectionPoolSize)
.build();
return AsyncConnectionPoolSupport.createBoundedObjectPool(() -> redisClient.connectAsync(StringCodec.UTF8, redisURI), boundedPoolConfig);
} By forcing the pool to initialize all connections in IDLE mode, then no "pool exhauted" error :) Cheers ! |
@Brico87 , Thanks for the comment, what is the best "connectionPoolSize" to manage, is it based the number of transactions per second or do need to follow some formula to define it. Please do clarify , thanks |
I think I let that to @mp911de answer that but I put a random 10 :) |
I try to test many solutions on my side and I finish by NOT using the AsyncPool. Instead, I used a ==> https://lettuce.io/core/release/reference/#connection-pooling.blocking.connection-pool-support Do you absolutely need to use |
I am seeing this issue too - approx 500K requests a minute, and this error occurs around 200 times. |
@Brico87 , yes ASYC is must , in ConnectionPoolSupport.createGenericObjectPool getting same error |
Hi @sksamuel, possible to share your code on connection and executing commend |
@vsharathis , can you elaborate the need of async here? |
IIRC, I was increase the max pooled number, I have no access to the codes now. @vsharathis ,sorry。 |
Why would it even throw an exception like this instead of returning the connection later when it's available? |
Bug Report
Current Behavior
Stack trace
Input Code
Input Code
Expected behavior/code
Environment
Possible Solution
Additional context
The text was updated successfully, but these errors were encountered: