mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
removeAbandanded skip running connections
This commit is contained in:
@@ -1075,11 +1075,16 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
|
||||
for (; iter.hasNext();) {
|
||||
Map.Entry<DruidPooledConnection, ActiveConnectionTraceInfo> entry = iter.next();
|
||||
DruidPooledConnection pooledConnection = entry.getKey();
|
||||
|
||||
if (pooledConnection.isRunning()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ActiveConnectionTraceInfo activeInfo = entry.getValue();
|
||||
long timeMillis = currentMillis - activeInfo.getConnectTime();
|
||||
|
||||
if (timeMillis >= removeAbandonedTimeoutMillis) {
|
||||
DruidPooledConnection pooledConnection = entry.getKey();
|
||||
JdbcUtils.close(pooledConnection);
|
||||
removeAbandonedCount++;
|
||||
removeCount++;
|
||||
|
||||
Reference in New Issue
Block a user