vamossagar12 commented on code in PR #12121:
URL: https://github.com/apache/kafka/pull/12121#discussion_r867424245
##########
clients/src/main/java/org/apache/kafka/common/metrics/Metrics.java:
##########
@@ -524,6 +524,58 @@ public void addMetric(MetricName metricName,
MetricValueProvider<?> metricValueP
addMetric(metricName, null, metricValueProvider);
}
+ /**
Review Comment:
@jolshan , the motivation is listed here =>
https://issues.apache.org/jira/projects/KAFKA/issues/KAFKA-13846?filter=allopenissues&orderby=created+DESC%2C+priority+DESC%2C+updated+DESC
As mentioned in the JIRA, currently the metric create operation relies on an
IllegalArguementException in case of multi-threaded metric creation for the
same metric. The other way is to syncrhonize the outer create call. This PR
aims to make that process cleaner.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]