question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NoSuchElementException: Pool exhausted when starting app

See original GitHub issue

Bug 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:closed
  • Created 3 years ago
  • Comments:21 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
Brico87commented, Jun 15, 2022

I think I let that to @mp911de answer that but I put a random 10 😃

0reactions
He-Pincommented, Oct 3, 2022

IIRC, I was increase the max pooled number, I have no access to the codes now. @vsharathis ,sorry。

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found