Fix a fast-spin loop when the pool is suspended and and connections are attempted to be added.

pull/201/head
Brett Wooldridge 10 years ago
parent 9f3c5ed2ca
commit da4ffe6d18

@ -432,7 +432,7 @@ public final class HikariPool implements HikariPoolMBean, IBagStateListener
// Speculative increment of totalConnections with expectation of success
if (totalConnections.incrementAndGet() > configuration.getMaximumPoolSize() || isShutdown || isPoolSuspended) {
totalConnections.decrementAndGet();
return true;
return !isPoolSuspended;
}
Connection connection = null;

@ -412,7 +412,7 @@ public final class HikariPool implements HikariPoolMBean, IBagStateListener
// Speculative increment of totalConnections with expectation of success
if (totalConnections.incrementAndGet() > configuration.getMaximumPoolSize() || isShutdown || isPoolSuspended) {
totalConnections.decrementAndGet();
return true;
return !isPoolSuspended;
}
Connection connection = null;

Loading…
Cancel
Save