Bill Bejeck created KAFKA-19504:
-----------------------------------
Summary: AdminClient creates and adds second metrics reporter
Key: KAFKA-19504
URL: https://issues.apache.org/jira/browse/KAFKA-19504
Project: Kafka
Issue Type: Task
Components: clients
Affects Versions: 4.1.0
Reporter: Bill Bejeck
The `AdminClient` adds a telemetry reporter to the metrics reporters list in
the constructor. The problem is that the reporter was already added in the
`createInternal` method. In the `createInternal` method call, the
`clientTelemetryReporter` is added to a `List<MetricReporters>` which is passed
to the `Metrics` object, will get closed when `Metrics.close()` is called. But
adding a reporter to the reporters list in the constructor is not used by the
`Metrics` object and hence doesn't get closed, causing a memory leak. Note,
this problem only exists if telemetry metrics is enabled for the `AdminClient`
and it is disabled by default.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)