From 4dad2469fe718962e401954024a2866ce469806b Mon Sep 17 00:00:00 2001 From: Pavel Ptashyts <49400901+pavel-ptashyts@users.noreply.github.com> Date: Mon, 20 Jul 2026 10:49:13 +0200 Subject: [PATCH] Skip empty pool partitions during reap Skip idle-reaper processing for partition deques that are already empty. This keeps the cleaner from creating an iterator for empty retained partitions while preserving existing debug accounting and all non-empty reap behavior. Codex on behalf of Pavel Ptashyts Co-Authored-By: Codex --- .../org/asynchttpclient/netty/channel/DefaultChannelPool.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/src/main/java/org/asynchttpclient/netty/channel/DefaultChannelPool.java b/client/src/main/java/org/asynchttpclient/netty/channel/DefaultChannelPool.java index f59d427f9..7811f16bd 100755 --- a/client/src/main/java/org/asynchttpclient/netty/channel/DefaultChannelPool.java +++ b/client/src/main/java/org/asynchttpclient/netty/channel/DefaultChannelPool.java @@ -362,6 +362,10 @@ public void run(Timeout timeout) { totalCount += partition.size(); } + if (partition.isEmpty()) { + continue; + } + closedCount += reapPartition(partition, start); }