AndrewJSchofield commented on code in PR #18332: URL: https://github.com/apache/kafka/pull/18332#discussion_r1905149430
########## clients/src/main/java/org/apache/kafka/common/metrics/JmxReporter.java: ########## @@ -207,6 +209,12 @@ private void unregister(KafkaMbean mbean) { } private void reregister(KafkaMbean mbean) { + // avoid re-registering after being closed, which could lead to memory leaks + // See KAFKA-18337 for more detail. + if (closed) { + log.warn("JmxReporter has been closed!, cannot re-registering mbean {}", mbean); Review Comment: nit: Grammar. Maybe "JmxReporter has been closed. Cannot reregister mbean {}". -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org