From 2b5e703902856779cac5cf1e1aeefa7a127ed4c8 Mon Sep 17 00:00:00 2001 From: "Xu Han@AutoMQ" Date: Mon, 9 Sep 2024 16:27:09 +0800 Subject: [PATCH] fix(issues1999): fix Processor.channelContexts memory leak (#2000) Signed-off-by: Robin Han --- core/src/main/scala/kafka/network/SocketServer.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/main/scala/kafka/network/SocketServer.scala b/core/src/main/scala/kafka/network/SocketServer.scala index be58bd27dd..8b38d3aa3f 100644 --- a/core/src/main/scala/kafka/network/SocketServer.scala +++ b/core/src/main/scala/kafka/network/SocketServer.scala @@ -1267,6 +1267,7 @@ private[kafka] class Processor( val remove = connectionId.equals(e.getValue.request.context.connectionId) remove }) + channelContexts.remove(connectionId) // the channel has been closed by the selector but the quotas still need to be updated connectionQuotas.dec(listenerName, InetAddress.getByName(remoteHost)) } catch {