Skip to content

Commit

Permalink
Fix idle timeout tests, sleep too tight to idle threshold.
Browse files Browse the repository at this point in the history
  • Loading branch information
brettwooldridge committed Aug 4, 2021
1 parent c40a690 commit e0ec6b7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/com/zaxxer/hikari/pool/HikariPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,7 @@ else if (now > plusMillis(previous, (3 * housekeepingPeriodMs) / 2)) {
final var notInUse = connectionBag.values(STATE_NOT_IN_USE);
var toRemove = notInUse.size() - config.getMinimumIdle();
for (PoolEntry entry : notInUse) {
logger.debug("Checking connection entry: {}", entry);
if (toRemove > 0 && elapsedMillis(entry.lastAccessed, now) > idleTimeout && connectionBag.reserve(entry)) {
closeConnection(entry, "(connection has passed idleTimeout)");
toRemove--;
Expand Down

0 comments on commit e0ec6b7

Please sign in to comment.