You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2022/01/28 02:26:02 UTC

[GitHub] [hadoop] tomscut commented on a change in pull request #3928: HDFS-16438. Avoid holding read locks for a long time when scanDatanodeStorage

tomscut commented on a change in pull request #3928:
URL: https://github.com/apache/hadoop/pull/3928#discussion_r794158272



##########
File path: hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeAdminBackoffMonitor.java
##########
@@ -665,6 +672,16 @@ private void scanDatanodeStorage(DatanodeDescriptor dn,
             blockList.put(b, null);
           }
           numBlocksChecked++;
+          if (Time.monotonicNow() - beginTime > scanDatanodeStorageLockTimeMs) {
+            namesystem.readUnlock();
+            try {
+              Thread.sleep(1);

Review comment:
       > Is 1ms sleep time enough to remove lock starvation or we should add bit more?
   
   Thanks @virajjasani for your review, I am trying a new implementation now, this code may be replaced.




-- 
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: common-issues-unsubscribe@hadoop.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org