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

Virtual threads permanently blocking on JedisPool#getResource #3927

Open
Brian1KB opened this issue Aug 21, 2024 · 2 comments
Open

Virtual threads permanently blocking on JedisPool#getResource #3927

Brian1KB opened this issue Aug 21, 2024 · 2 comments
Labels
dependencies Pull request that updates a dependency tracking-issue An issue container, effectively an epic

Comments

@Brian1KB
Copy link

Expected behavior

Expecting for a Jedis object to be returned from the pool

Actual behavior

The getResource function permanently blocks

Steps to reproduce:

Call getResource at a high frequency, in a short period of time from a virtual thread per task executor. It is caused as a result of this issue that has had a PR filed under Apache Commons Pool, but I wanted to track the issue here in addition as it blocks Loom support until it is resolved. (apache/commons-pool#339)

      JedisPool jedisPool = new JedisPool();

      Executor executor = Executors.newVirtualThreadPerTaskExecutor();

      for (int i = 0; i < 1000; i++)
      {
          executor.execute(() ->
          {
              System.out.println("Attempting to getResource");

              try (Jedis instance = jedisPool.getResource())
              {
                  System.out.println("Acquired resource");
                  
                  instance.ping();
              }
          });
      }

Acquired resource will never print.

Redis / Jedis Configuration

Jedis version:

5.2.0-SNAPSHOT (latest build of 5.2.0 branch)

Redis version:

unrelated

Java version:

Eclipse Adoptium jdk-21.0.0.35-hotspot

@sazzad16 sazzad16 added the dependencies Pull request that updates a dependency label Aug 21, 2024
@sazzad16 sazzad16 added the tracking-issue An issue container, effectively an epic label Oct 20, 2024
@LeedY1232
Copy link

I've tried with latest version,which is the 5.2.0 GA version, it seems that this problem has been solved. Has it over yet?

@LeedY1232
Copy link

I've tried with latest version,which is the 5.2.0 GA version, it seems that this problem has been solved. Has it over yet?

my jdk version is oracle openjdk 21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull request that updates a dependency tracking-issue An issue container, effectively an epic
Projects
None yet
Development

No branches or pull requests

3 participants