tanvipenumudy commented on a change in pull request #3180:
URL: https://github.com/apache/ozone/pull/3180#discussion_r840848172



##########
File path: 
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/lock/OzoneManagerLock.java
##########
@@ -172,7 +176,16 @@ private boolean lock(Resource resource, String 
resourceName,
       LOG.error(errorMessage);
       throw new RuntimeException(errorMessage);
     } else {
+      long startWaitingTimeNanos = Time.monotonicNowNanos();
+      /**
+       *  holdCount helps in metric updation only once in case of reentrant
+       *  locks.
+       */
+      int holdCount = manager.getActiveLockCount(resourceName);
       lockFn.accept(resourceName);
+      if (holdCount == 0) {
+        updateReadLockMetrics(resource, lockType, startWaitingTimeNanos);
+      }

Review comment:
       Hi @adoroszlai, please find the changes addressing the multiple readers 
metrics updation problem, thanks




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to