mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for "dup close"
This commit is contained in:
@@ -917,6 +917,8 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
|
||||
long currentMillis = System.currentTimeMillis();
|
||||
|
||||
List<PoolableConnection> abondonedList = new ArrayList<PoolableConnection>();
|
||||
|
||||
for (; iter.hasNext();) {
|
||||
Map.Entry<PoolableConnection, ActiveConnectionTraceInfo> entry = iter.next();
|
||||
ActiveConnectionTraceInfo activeInfo = entry.getValue();
|
||||
@@ -927,6 +929,7 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
JdbcUtils.close(pooledConnection);
|
||||
removeAbandonedCount++;
|
||||
removeCount++;
|
||||
abondonedList.add(pooledConnection);
|
||||
|
||||
if (isLogAbandoned()) {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
@@ -943,6 +946,11 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// multi-check dup close
|
||||
for (PoolableConnection conn : abondonedList) {
|
||||
activeConnections.remove(conn);
|
||||
}
|
||||
|
||||
return removeCount;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user