mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
close connection if putLast failed during fill operation
This commit is contained in:
@@ -3823,17 +3823,23 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
throw new SQLException("interrupt", e);
|
||||
}
|
||||
|
||||
boolean result;
|
||||
try {
|
||||
if (!this.isFillable(toCount)) {
|
||||
JdbcUtils.close(holder.getConnection());
|
||||
LOG.info("fill connections skip.");
|
||||
break;
|
||||
}
|
||||
this.putLast(holder, System.currentTimeMillis());
|
||||
result = this.putLast(holder, System.currentTimeMillis());
|
||||
fillCount++;
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
if (!result) {
|
||||
JdbcUtils.close(holder.getConnection());
|
||||
LOG.info("connection fill failed.");
|
||||
}
|
||||
}
|
||||
|
||||
if (LOG.isInfoEnabled()) {
|
||||
|
||||
Reference in New Issue
Block a user