Issue #563 Do not start the house-keeping thread until after pool initialisation has completed.

pull/564/head
Brett Wooldridge 9 years ago
parent f7c8118a86
commit bd7e3ba6db

@ -2,9 +2,18 @@ HikariCP Changes
Changes in 2.4.4 Changes in 2.4.4
* issue 563: Do not start the house-keeping thread until after pool initialisation
has succeeded.
* issue 559: Ensure the pool refill after house-keeping does not enqueue more add
connection requests if there are already minimumIdle requests pending.
* issue 555: include support for Java 8 interface 'default' methods during proxy * issue 555: include support for Java 8 interface 'default' methods during proxy
generation. generation.
* issue 547: decreased allowable minimum connectionTimeout and validationTimeout to
250ms.
* issue 495: implemented iterator() method on custom FastList to support Tomcat * issue 495: implemented iterator() method on custom FastList to support Tomcat
memory leak detection. memory leak detection.
@ -31,7 +40,7 @@ Changes in 2.4.2
subsequent new connection creation load on the database. Connections now have a subsequent new connection creation load on the database. Connections now have a
maximum lifetime between 97.5-100% of configured maxLifetime. In the case of the maximum lifetime between 97.5-100% of configured maxLifetime. In the case of the
default 30 minute lifetime, this generates actual lifetimes with a maximum deviation default 30 minute lifetime, this generates actual lifetimes with a maximum deviation
of 45 seconds. Currently, no attempt is made to futher avoid clustering that may of 45 seconds. Currently, no attempt is made to further avoid clustering that may
occur due to randomness. occur due to randomness.
* Ongoing com.zaxxer.hikari.metrics refactors. This is not considered public API until * Ongoing com.zaxxer.hikari.metrics refactors. This is not considered public API until

@ -107,6 +107,19 @@ public class HikariPool extends PoolBase implements HikariPoolMXBean, IBagStateL
this.addConnectionExecutor = createThreadPoolExecutor(config.getMaximumPoolSize(), "Hikari connection adder (pool " + poolName + ")", config.getThreadFactory(), new ThreadPoolExecutor.DiscardPolicy()); this.addConnectionExecutor = createThreadPoolExecutor(config.getMaximumPoolSize(), "Hikari connection adder (pool " + poolName + ")", config.getThreadFactory(), new ThreadPoolExecutor.DiscardPolicy());
this.closeConnectionExecutor = createThreadPoolExecutor(4, "Hikari connection closer (pool " + poolName + ")", config.getThreadFactory(), new ThreadPoolExecutor.CallerRunsPolicy()); this.closeConnectionExecutor = createThreadPoolExecutor(4, "Hikari connection closer (pool " + poolName + ")", config.getThreadFactory(), new ThreadPoolExecutor.CallerRunsPolicy());
if (config.getMetricsTrackerFactory() != null) {
setMetricsTrackerFactory(config.getMetricsTrackerFactory());
}
else {
setMetricRegistry(config.getMetricRegistry());
}
setHealthCheckRegistry(config.getHealthCheckRegistry());
registerMBeans(this);
initializeConnections();
if (config.getScheduledExecutorService() == null) { if (config.getScheduledExecutorService() == null) {
ThreadFactory threadFactory = config.getThreadFactory() != null ? config.getThreadFactory() : new DefaultThreadFactory("Hikari housekeeper (pool " + poolName + ")", true); ThreadFactory threadFactory = config.getThreadFactory() != null ? config.getThreadFactory() : new DefaultThreadFactory("Hikari housekeeper (pool " + poolName + ")", true);
this.houseKeepingExecutorService = new ScheduledThreadPoolExecutor(1, threadFactory, new ThreadPoolExecutor.DiscardPolicy()); this.houseKeepingExecutorService = new ScheduledThreadPoolExecutor(1, threadFactory, new ThreadPoolExecutor.DiscardPolicy());
@ -120,19 +133,6 @@ public class HikariPool extends PoolBase implements HikariPoolMXBean, IBagStateL
this.houseKeepingExecutorService.scheduleAtFixedRate(new HouseKeeper(), HOUSEKEEPING_PERIOD_MS, HOUSEKEEPING_PERIOD_MS, TimeUnit.MILLISECONDS); this.houseKeepingExecutorService.scheduleAtFixedRate(new HouseKeeper(), HOUSEKEEPING_PERIOD_MS, HOUSEKEEPING_PERIOD_MS, TimeUnit.MILLISECONDS);
this.leakTask = new ProxyLeakTask(config.getLeakDetectionThreshold(), houseKeepingExecutorService); this.leakTask = new ProxyLeakTask(config.getLeakDetectionThreshold(), houseKeepingExecutorService);
if (config.getMetricsTrackerFactory() != null) {
setMetricsTrackerFactory(config.getMetricsTrackerFactory());
}
else {
setMetricRegistry(config.getMetricRegistry());
}
setHealthCheckRegistry(config.getHealthCheckRegistry());
registerMBeans(this);
initializeConnections();
} }
/** /**

Loading…
Cancel
Save