Fixed Log before and after startup/shutdown.

pull/796/head
Brett Wooldridge
parent 9cc1fbcfca
commit 980d8dc2e0

@ -67,8 +67,9 @@ public class HikariDataSource extends HikariConfig implements DataSource, Closea
configuration.validate(); configuration.validate();
configuration.copyState(this); configuration.copyState(this);
LOGGER.info("{} - Started.", configuration.getPoolName()); LOGGER.info("{} - Starting...", configuration.getPoolName());
pool = fastPathPool = new HikariPool(this); pool = fastPathPool = new HikariPool(this);
LOGGER.info("{} - Start completed.", configuration.getPoolName());
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@ -90,8 +91,9 @@ public class HikariDataSource extends HikariConfig implements DataSource, Closea
result = pool; result = pool;
if (result == null) { if (result == null) {
validate(); validate();
LOGGER.info("{} - Started.", getPoolName()); LOGGER.info("{} - Starting...", getPoolName());
pool = result = new HikariPool(this); pool = result = new HikariPool(this);
LOGGER.info("{} - Start completed.", getPoolName());
} }
} }
} }
@ -301,10 +303,12 @@ public class HikariDataSource extends HikariConfig implements DataSource, Closea
HikariPool p = pool; HikariPool p = pool;
if (p != null) { if (p != null) {
try { try {
LOGGER.info("{} - Shutdown initiated...", getPoolName());
p.shutdown(); p.shutdown();
LOGGER.info("{} - Shutdown completed.", getPoolName());
} }
catch (InterruptedException e) { catch (InterruptedException e) {
LOGGER.warn("Interrupted during closing", e); LOGGER.warn("{} - Interrupted during closing", getPoolName(), e);
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
} }
} }

@ -201,8 +201,7 @@ public class HikariPool extends PoolBase implements HikariPoolMXBean, IBagStateL
return; return;
} }
LOGGER.info("{} - Close initiated...", poolName); logPoolState("Before shutdown ");
logPoolState("Before closing ");
if (houseKeeperTask != null) { if (houseKeeperTask != null) {
houseKeeperTask.cancel(false); houseKeeperTask.cancel(false);
@ -240,10 +239,9 @@ public class HikariPool extends PoolBase implements HikariPoolMXBean, IBagStateL
closeConnectionExecutor.awaitTermination(5L, SECONDS); closeConnectionExecutor.awaitTermination(5L, SECONDS);
} }
finally { finally {
logPoolState("After closing "); logPoolState("After shutdown ");
unregisterMBeans(); unregisterMBeans();
metricsTracker.close(); metricsTracker.close();
LOGGER.info("{} - Closed.", poolName);
} }
} }

Loading…
Cancel
Save