Skip to content

HikariPool.createPoolEntry: Log Throwables more visibly #2345

@sba0809

Description

@sba0809

HikariCP: com.zaxxer:HikariCP:6.3.0
DB Driver: com.ibm.db2.jcc: 11.5.9.0

Please have a look at this code snippet from HikariPool:

` private PoolEntry createPoolEntry()
{
try {
/// ... shortened ...
}
catch (ConnectionSetupException e) {
if (poolState == POOL_NORMAL) { // we check POOL_NORMAL to avoid a flood of messages if shutdown() is running concurrently
logger.debug("{} - Error thrown while acquiring connection from data source", poolName, e.getCause());
}
}
catch (Throwable e) {
if (poolState == POOL_NORMAL) { // we check POOL_NORMAL to avoid a flood of messages if shutdown() is running concurrently
logger.debug("{} - Cannot acquire connection from data source", poolName, e);
}
}

  return null;

}`

Any possible error will be logged at debug level.

We encountered the following situation: After a user successfully established a database connection, they changed their password. However, the connection pool still held an active connection with the old password, which was kept alive due to the minIdle setting. As a result, repeated login attempts were made using the outdated credentials, ultimately causing the user account to be locked again.

We were unable to detect any issue within our application, as Hikari only logs this authentication error at the debug level.

I would like to request that this kind of login failure be logged at least on the INFO level — ideally even as a WARN — to ensure better visibility and avoid repeated user account lockouts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions