-
Notifications
You must be signed in to change notification settings - Fork 205
Description
Version
4.3.1
Context
While submitting queries using connections manually retrieved from a pool, PoolOptions'a setConnectionTimeout() seems to take an effect as expected. For example, using a pool with 1 connection a flow that does
pool.getConnection()
-> doesn't close it and attempts to do another pool.getConnection()
will end up with a timeout exception.
This doesn't seem to be the case when pool.query("...").execute()
is used. Once the first connection is taken and the pool is exhausted the second attempt is simply stuck forever.
Do you have a reproducer?
Gist:
https://gist.github.com/ashertarno/2bf88dccc13667a93dfcc560e0974a9a
Steps to reproduce
The gist above provides two meethods: connectionTimeOut()
that mimics the working flow with two on demand retrieved connections and poolTimeOut()
with the first connection being retrieved manually to exhaust the pool and an attempt to call
pool.query().execute(). You can call each of these methods by editing main().