[ https://issues.apache.org/jira/browse/HDFS-17523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17859528#comment-17859528 ]
ASF GitHub Bot commented on HDFS-17523: --------------------------------------- slfan1989 commented on code in PR #6890: URL: https://github.com/apache/hadoop/pull/6890#discussion_r1650275417 ########## hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/AutoCloseDataSetLock.java: ########## @@ -30,17 +33,39 @@ * use a try-with-resource syntax. */ public class AutoCloseDataSetLock extends AutoCloseableLock { - private Lock lock; + + private final Lock lock; + + private final DataNodeLockManager<AutoCloseDataSetLock> dataNodeLockManager; + + private final boolean isReadLock; + + private static ThreadLocal<DataSetLockHeldInfo> heldInfoThreadLocal = new Review Comment: Thank you for your pr. It's necessary to add metrics, but there's an issue that needs clarification. In certain versions of JDK 17, particularly with G1, there are problems with ThreadLocal where entries cannot be properly GC'd. This issue can cause unusually high CPU usage. I'll provide more details later. > Add fine-grained locks metrics in DataSetLockManager > ----------------------------------------------------- > > Key: HDFS-17523 > URL: https://issues.apache.org/jira/browse/HDFS-17523 > Project: Hadoop HDFS > Issue Type: Improvement > Reporter: lei w > Priority: Major > Labels: pull-request-available > > Currently we use fine-grained locks to manage FsDataSetImpl. But we did not > add lock-related metrics. In some cases, we actually need lock-holding > information to understand the time-consuming lock-holding of a certain > operation. Using this information, we can also optimize some long-term lock > operations as early as possible. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org