brettwooldridge / HikariCP

光 HikariCP・A solid, high-performance, JDBC connection pool at last.
Apache License 2.0
19.91k stars 2.92k forks source link

PoolEntryCreator logs "Connection not added" when connection is added #2163

Closed jgchristian closed 8 months ago

jgchristian commented 8 months ago

The logging logic in PoolEntryCreator seems to be incorrectly logging "Connection not added, " if the loggingPrefix value is null - even if the connection was added.

The poolEntryCreator variable in HikariPool is instantiated without a loggingPrefix, so this execution path always run, even if a connection was added

I've created a minimalist PR that I think fixes the issue. However, based on other references to loggingPrefix in conditional statements in PoolEntryCreator.call(), it seems like the intent is not to log if loggingPrefix is null... but in the case of a connection not being added, a logging prefix is hardcoded to "Connection not added, "... so I'm not clear on the intent :) Perhaps it needs a more thorough reworking/clarification of the logic?