[
https://issues.apache.org/jira/browse/KAFKA-21048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18112899#comment-18112899
]
Lianet Magrans commented on KAFKA-21048:
----------------------------------------
Hey folks, I just removed the 4.4 fix version since this is minor and we're
past code freeze. Feel free to add 4.5 if there is PR coming. Thanks!
> 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
> Priority: Minor
>
> 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)