complone commented on code in PR #7306:
URL: https://github.com/apache/hudi/pull/7306#discussion_r1040184209


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/transaction/lock/metrics/HoodieLockMetrics.java:
##########
@@ -70,11 +71,13 @@ private String getMetricsName(String metric) {
 
   private Timer createTimerForMetrics(MetricRegistry registry, String metric) {
     String metricName = getMetricsName(metric);
-    synchronized (REGISTRY_LOCK) {
-      if (registry.getMetrics().get(metricName) == null) {
-        lockDuration = new Timer(new SlidingWindowReservoir(keepLastNtimes));
-        registry.register(metricName, lockDuration);
-        return lockDuration;
+    if (registry.getMetrics().get(metricName) == null) {
+      synchronized (Registry.class) {
+        if (registry.getMetrics().get(metricName) == null) {

Review Comment:
   > 为什么`REGISTRY_LOCK`不能在这里正常工作,你能详细解释一下吗?
   
   I have updated the description



-- 
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]

Reply via email to