hfutatzhanghb commented on code in PR #6762:
URL: https://github.com/apache/hadoop/pull/6762#discussion_r1897587322


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java:
##########
@@ -2031,7 +2053,7 @@ BatchedListEntries<OpenFileEntry> listOpenFiles(long 
prevId,
     BatchedListEntries<OpenFileEntry> batchedListEntries;
     String normalizedPath = new Path(path).toString(); // normalize path.
     try {
-      readLock();
+      readLock(RwLockMode.FS);

Review Comment:
   Also use GLOBAL mode here, because it invoke getFilesBlockingDecom method.



##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java:
##########
@@ -2058,7 +2080,7 @@ BatchedListEntries<OpenFileEntry> listOpenFiles(long 
prevId,
 
   public BatchedListEntries<OpenFileEntry> getFilesBlockingDecom(long prevId,
       String path) {
-    assert hasReadLock();
+    assert hasReadLock(RwLockMode.FS);

Review Comment:
   I think we should use GLOBAL mode here, because below codes contain iterate 
`blockManager.getDatanodeManager().getDatanodes()`



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