Fixed #781 Log before and after startup/shutdown.

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

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

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

Loading…
Cancel
Save