Jheng-Sing Chen created KAFKA-21048:
---------------------------------------
Summary: DumpLogSegmentsTest leaks BrokerTopicStats and causes
JmxToolTest to fail
Key: KAFKA-21048
URL: https://issues.apache.org/jira/browse/KAFKA-21048
Project: Kafka
Issue Type: Improvement
Affects Versions: 4.4.0
Reporter: Jheng-Sing Chen
Assignee: Jheng-Sing Chen
Fix For: 4.4.0
DumpLogSegmentsTest creates a BrokerTopicStats instance but does not close it.
When JmxToolTest runs afterward, it fails because the same MBean is still
registered:
javax.management.InstanceAlreadyExistsException:
kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec
Reproduce with:
./gradlew :tools:unitTest \
--tests org.apache.kafka.tools.DumpLogSegmentsTest \
--tests org.apache.kafka.tools.JmxToolTest \
-PmaxParallelForks=1 --max-workers=1 --rerun
Reproduced on Kafka 4.4.0-rc0 and trunk.
The proposed fix is to retain BrokerTopicStats in DumpLogSegmentsTest and close
it during tearDown.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)