redis / jedis

Redis Java client
MIT License
11.78k stars 3.86k forks source link

Java 21 and Virtual Threads: Timeout waiting for idle object #3905

Open qyyxl opened 1 month ago

qyyxl commented 1 month ago

Actual behavior

The following error occurs when I change the application's business thread to a virtual thread and the traffic suddenly increases:

    Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
        at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:461)
        at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:375)
        at redis.clients.util.Pool.getResource(Pool.java:49)
        at credis.java.client.pool.impl.CRedisJedisPool.getResource(CRedisJedisPool.java:103)

Redis / Jedis Configuration

Java version:jdk21

sazzad16 commented 1 month ago

@qyyxl

First of all, please mention relevant versions.

Jedis does not have any official release supporting virtual threads. But it expected from 5.2.0. In the mean time, the support is available in latest 5.2.0-SNAPSHOTs.

sazzad16 commented 1 week ago

Could be related to #3927