d-c-manning commented on code in PR #5081:
URL: https://github.com/apache/hbase/pull/5081#discussion_r1127203389


##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java:
##########
@@ -1112,6 +1114,11 @@ rpcControllerFactory, getMetaLookupPool(), 
connectionConfig.getMetaReadRpcTimeou
             ConnectionUtils.getPauseTime(pauseBase, tries), 
TimeUnit.MILLISECONDS);
         }
       } finally {
+        // update duration of the lock being held

Review Comment:
   Okay. I guess we could make a local copy of the variable before leaving the 
lock, and still update the metric outside of the lock. It's nitpicky, but 
always good to minimize work under lock.
   
   The fact that we're worried about multithreaded access to this variable also 
makes me wonder if we can just remove the class variable. `takeUserRegionLock` 
could return the `userRegionLockHeldStartTime`... or even easier: just record 
the start time immediately after calling `takeUserRegionLock`. Then we have all 
the context within `locateRegionInMeta`.



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