Skip to content

Commit 45a8b4b

Browse files
committed
Properly remove entry from partition, close AsyncHttpClient#1461
Motivation: DefaultChannelPool#removeAll fails to properly remove entry from partition. Modification: Remove an `IdleChannel` instead of a `Channel`. Result: No more leak.
1 parent 7b60e71 commit 45a8b4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

client/src/main/java/org/asynchttpclient/netty/channel/DefaultChannelPool.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ else if (isRemotelyClosed(idleChannel.channel)) {
309309
*/
310310
public boolean removeAll(Channel channel) {
311311
ChannelCreation creation = connectionTtlEnabled ? channelId2Creation.remove(channelId(channel)) : null;
312-
return !isClosed.get() && creation != null && partitions.get(creation.partitionKey).remove(channel);
312+
return !isClosed.get() && creation != null && partitions.get(creation.partitionKey).remove(new IdleChannel(channel, Long.MIN_VALUE));
313313
}
314314

315315
/**

0 commit comments

Comments
 (0)