Divij Vaidya created KAFKA-16074:
------------------------------------
Summary: Fix thread leaks in ReplicaManagerTest
Key: KAFKA-16074
URL: https://issues.apache.org/jira/browse/KAFKA-16074
Project: Kafka
Issue Type: Sub-task
Reporter: Luke Chen
Assignee: Luke Chen
Following [@dajac|https://github.com/dajac] 's finding in
[#15063|https://github.com/apache/kafka/pull/15063], I found we also create new
RemoteLogManager in ReplicaManagerTest, but didn't close them.
While investigating ReplicaManagerTest, I also found there are other threads
leaking:
# remote fetch reaper thread. It's because we create a reaper thread in test,
which is not expected. We should create a mocked one like other purgatory
instance.
# Throttle threads. We created a {{quotaManager}} to feed into the
replicaManager, but didn't close it. Actually, we have created a global
{{quotaManager}} instance and will close it on {{{}AfterEach{}}}. We should
re-use it.
# replicaManager and logManager didn't invoke {{close}} after test.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)