Motivation:
Shutdown may be invoked as a result of checkFailFast failing resulting in an NPE as the executors are setup later in the constructor.
Modifications:
Add null checks before trying to shutdown the executors.
Result:
"Graceful" shutdown.
Not handling it avoids eviction of the connection and corrupts the pool.
For example the following NullPointerException is thrown when trying to use the pool afterwards:
java.lang.NullPointerException at com.zaxxer.hikari.pool.PoolBase.isConnectionAlive(PoolBase.java:128)
at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:171)
at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:147)
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:99)
.......
removed var
removed resetting, delink validationTimeout from connectionTimeout
one less ref per leak task. renamed start() to schedule()
made some fields final
init of leakDetectionThreshold is not required for other instances
toString using elapsedDisplayString
fix: update poolEntry.lastBorrowed in case NopMetricsTrackerDelegate
fix tests.. try1
setting isCommitStateDirty conditionally in setAutoCommit()
again, avoid calling getNextException :)
setting lastAccess in close()
setting lastAccess required only in ctor and close
removed borrowed time from PoolEntry#toString()
now that lastAccess is moved to close(), moved condition too
one less call to System.nanoTime()
fix. using toNanos()
reverted toNanos() change, got too cumbersome
removed two calls to system time
timeout is not clock time :)
only one call saved but precise 'time taken to borrow'
unlink validation of connectionTimeout with maxLifetime
Merge
Revert