Fix timeout calculation when skipping unusable connections from pool

pull/95/head
Jonas Berlin 11 years ago
parent ed9c5cad01
commit 4c238613b0

@ -170,7 +170,7 @@ public final class HikariPool implements HikariPoolMBean, IBagStateListener
if (now > connection.getExpirationTime() || (now - connection.getLastAccess() > 1000L && !isConnectionAlive(connection, timeout))) {
closeConnection(connection); // Throw away the dead connection and try again
timeout -= elapsedTimeMs(start);
timeout = connectionTimeout - elapsedTimeMs(start);
continue;
}
else if (leakDetectionThreshold != 0) {

@ -169,7 +169,7 @@ public final class HikariPool implements HikariPoolMBean, IBagStateListener
if (now > connection.getExpirationTime() || (now - connection.getLastAccess() > 1000L && !isConnectionAlive(connection, timeout))) {
closeConnection(connection); // Throw away the dead connection and try again
timeout -= elapsedTimeMs(start);
timeout = connectionTimeout - elapsedTimeMs(start);
continue;
}
else if (leakDetectionThreshold != 0) {

Loading…
Cancel
Save