cmccabe commented on code in PR #12837: URL: https://github.com/apache/kafka/pull/12837#discussion_r1036536740
########## raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java: ########## @@ -2368,6 +2368,10 @@ public void close() { if (kafkaRaftMetrics != null) { kafkaRaftMetrics.close(); } + if (memoryPool instanceof BatchMemoryPool) { Review Comment: I have been playing whack-a-mole with cases where we leak `KafkaRaftClient` instances in tests. Most of them seem to be related to the metrics closures dragging in giant objects, and the metrics not getting deleted properly. These are existing issues not caused by this PR. This is a bit ugly but it stabilizes the build greatly so I think we should leave it in. I didn't want to make it a close() function since I didn't want to start thinking about dealing with a closed state in all of the memory pools. Can we leave this for now and open a JIRA? -- 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