[ https://issues.apache.org/jira/browse/KAFKA-16381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chia-Ping Tsai resolved KAFKA-16381. ------------------------------------ Fix Version/s: 3.8.0 Resolution: Fixed > use volatile to guarantee KafkaMetric#config visibility across threads > ---------------------------------------------------------------------- > > Key: KAFKA-16381 > URL: https://issues.apache.org/jira/browse/KAFKA-16381 > Project: Kafka > Issue Type: Bug > Reporter: Johnny Hsu > Assignee: Johnny Hsu > Priority: Minor > Fix For: 3.8.0 > > > 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)