File tree 1 file changed +9
-7
lines changed
providers/netty/src/main/java/org/asynchttpclient/providers/netty/channel/pool 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -198,19 +198,21 @@ public void run(Timeout timeout) throws Exception {
198
198
int closedCount = 0 ;
199
199
int totalCount = 0 ;
200
200
201
- for (Map . Entry < String , ConcurrentLinkedQueue <IdleChannel >> entry : poolsPerKey .entrySet ()) {
201
+ for (ConcurrentLinkedQueue <IdleChannel > pool : poolsPerKey .values ()) {
202
202
203
- String poolKey = entry .getKey ();
204
- ConcurrentLinkedQueue <IdleChannel > pool = entry .getValue ();
205
203
// store in intermediate unsynchronized lists to minimize the impact on the ConcurrentLinkedQueue
206
204
if (LOGGER .isDebugEnabled ())
207
205
totalCount += pool .size ();
208
206
209
207
List <IdleChannel > closedChannels = closeChannels (expiredChannels (pool , start ));
210
- pool .removeAll (closedChannels );
211
- closedCount += closedChannels .size ();
212
- if (pool .isEmpty ())
213
- poolsPerKey .remove (poolKey );
208
+
209
+ if (!closedChannels .isEmpty ()) {
210
+ for (IdleChannel closedChannel : closedChannels )
211
+ channel2Creation .remove (closedChannel .channel );
212
+
213
+ pool .removeAll (closedChannels );
214
+ closedCount += closedChannels .size ();
215
+ }
214
216
}
215
217
216
218
long duration = millisTime () - start ;
You can’t perform that action at this time.
0 commit comments