Skip to content

PgPool queries seem to disregard setConnectionTimeout setting #1232

@ashertarno

Description

@ashertarno

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().

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions