From a114ec3b22c53bae813fb885fa5c9e6f04902ac4 Mon Sep 17 00:00:00 2001 From: Shichao Nie Date: Thu, 12 Sep 2024 17:31:08 +0800 Subject: [PATCH] fix(core): remove offset metrics when expired (#2023) Signed-off-by: Shichao Nie --- core/src/main/scala/kafka/coordinator/group/GroupMetadata.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/main/scala/kafka/coordinator/group/GroupMetadata.scala b/core/src/main/scala/kafka/coordinator/group/GroupMetadata.scala index 547a3e6965..59bdadb631 100644 --- a/core/src/main/scala/kafka/coordinator/group/GroupMetadata.scala +++ b/core/src/main/scala/kafka/coordinator/group/GroupMetadata.scala @@ -846,6 +846,7 @@ private[group] class GroupMetadata(val groupId: String, initialState: GroupState debug(s"Expired offsets from group '$groupId': ${expiredOffsets.keySet}") offsets --= expiredOffsets.keySet + expiredOffsets.keySet.foreach(removeOffsetMetric) expiredOffsets }