diff --git a/CHANGES b/CHANGES index 14586f4d..12c897db 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ HikariCP Changes +Changes in 6.2.2 + + * increase keepaliveTime variance from 10% to 20% + Changes in 6.2.1 * change default keepaliveTime to 2 minutes diff --git a/src/main/java/com/zaxxer/hikari/pool/HikariPool.java b/src/main/java/com/zaxxer/hikari/pool/HikariPool.java index 002fcd69..765ed985 100644 --- a/src/main/java/com/zaxxer/hikari/pool/HikariPool.java +++ b/src/main/java/com/zaxxer/hikari/pool/HikariPool.java @@ -493,8 +493,8 @@ public final class HikariPool extends PoolBase implements HikariPoolMXBean, IBag final long keepaliveTime = config.getKeepaliveTime(); if (keepaliveTime > 0) { - // variance up to 10% of the heartbeat time - final var variance = ThreadLocalRandom.current().nextLong(keepaliveTime / 10); + // variance up to 20% of the heartbeat time + final var variance = ThreadLocalRandom.current().nextLong(keepaliveTime / 5); final var heartbeatTime = keepaliveTime - variance; poolEntry.setKeepalive(houseKeepingExecutorService.scheduleWithFixedDelay(new KeepaliveTask(poolEntry), heartbeatTime, heartbeatTime, MILLISECONDS)); }