You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Johnny Hsu (Jira)" <ji...@apache.org> on 2024/03/17 16:03:00 UTC
[jira] [Created] (KAFKA-16381) We should use a lock to protect the config getter in KafkaMetric
Johnny Hsu created KAFKA-16381:
----------------------------------
Summary: We should use a lock to protect the config getter in KafkaMetric
Key: KAFKA-16381
URL: https://issues.apache.org/jira/browse/KAFKA-16381
Project: Kafka
Issue Type: Bug
Reporter: Johnny Hsu
Assignee: Johnny Hsu
In KafkaMetirc.java, the getter is
```
@Override
public MetricName metricName() {
return this.metricName;
}
```
and there is a setter
```
public void config(MetricConfig config) {
synchronized (lock) {
this.config = config;
}
}
```
Since it's possible to set and get in the mean time, we should have lock in the getter as well
--
This message was sent by Atlassian Jira
(v8.20.10#820010)