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)

Reply via email to