You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/05/08 02:14:38 UTC

[GitHub] [kafka] vamossagar12 commented on a diff in pull request #12121: KAFKA-13846: Adding overloaded metricOrElseCreate method

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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org