Skip to content

Commit 468b98f

Browse files
committed
Properly remove entry from partition, close #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 3975e72 commit 468b98f

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ else if (isRemotelyClosed(idleChannel.channel)) {
312312
*/
313313
public boolean removeAll(Channel channel) {
314314
ChannelCreation creation = connectionTtlEnabled ? channelId2Creation.remove(channel.id()) : null;
315-
return !isClosed.get() && creation != null && partitions.get(creation.partitionKey).remove(channel);
315+
return !isClosed.get() && creation != null && partitions.get(creation.partitionKey).remove(new IdleChannel(channel, Long.MIN_VALUE));
316316
}
317317

318318
/**

0 commit comments

Comments
 (0)