Fixes #465 fix apparent leak of one connection leak at startup when minimumIdle=0 ... the connection is not leaked, but the ProxyLeakTask was not cancelled.

pull/480/head
Brett Wooldridge 9 years ago
parent 755f2da615
commit 37b96f1ed9

@ -252,11 +252,14 @@ public class HikariPool extends PoolBase implements HikariPoolMXBean, IBagStateL
/**
* Evict a connection from the pool.
*
* @param proxyConnection the connection to evict
* @param connection the connection to evict
*/
public final void evictConnection(Connection proxyConnection)
public final void evictConnection(Connection connection)
{
softEvictConnection(((ProxyConnection) proxyConnection).getPoolEntry(), "(connection evicted by user)", true /* owner */);
ProxyConnection proxyConnection = (ProxyConnection) connection;
proxyConnection.cancelLeakTask();
softEvictConnection(proxyConnection.getPoolEntry(), "(connection evicted by user)", true /* owner */);
}
public void setMetricRegistry(Object metricRegistry)

@ -133,16 +133,14 @@ public abstract class ProxyConnection implements Connection
}
// ***********************************************************************
// IHikariConnectionProxy methods
// Internal methods
// ***********************************************************************
/** {@inheritDoc} */
final PoolEntry getPoolEntry()
{
return poolEntry;
}
/** {@inheritDoc} */
final SQLException checkException(final SQLException sqle)
{
final String sqlState = sqle.getSQLState();
@ -165,13 +163,11 @@ public abstract class ProxyConnection implements Connection
return sqle;
}
/** {@inheritDoc} */
final void untrackStatement(final Statement statement)
{
openStatements.remove(statement);
}
/** {@inheritDoc} */
final void markCommitStateDirty()
{
if (isAutoCommit) {
@ -182,9 +178,13 @@ public abstract class ProxyConnection implements Connection
}
}
// ***********************************************************************
// Internal methods
// ***********************************************************************
/**
*
*/
void cancelLeakTask()
{
leakTask.cancel();
}
private final <T extends Statement> T trackStatement(final T statement)
{

Loading…
Cancel
Save