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 2023/01/04 01:30:12 UTC

[GitHub] [hadoop] szetszwo commented on a diff in pull request #5268: HDFS-16881. Warn if AccessControlEnforcer runs for a long time to check permission.

szetszwo commented on code in PR #5268:
URL: https://github.com/apache/hadoop/pull/5268#discussion_r1061074364


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java:
##########
@@ -388,6 +392,12 @@ public enum DirOp {
         DFS_PROTECTED_SUBDIRECTORIES_ENABLE,
         DFS_PROTECTED_SUBDIRECTORIES_ENABLE_DEFAULT);
 
+    final long readLockThresholdMs = conf.getLong(
+        DFS_NAMENODE_READ_LOCK_REPORTING_THRESHOLD_MS_KEY,
+        DFS_NAMENODE_READ_LOCK_REPORTING_THRESHOLD_MS_DEFAULT);
+    // use half of read lock threshold

Review Comment:
   Indeed, let's make it configurable.



##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSPermissionChecker.java:
##########
@@ -446,4 +447,20 @@ private static INodeFile createINodeFile(INodeDirectory parent, String name,
     parent.addChild(inodeFile);
     return inodeFile;
   }
+
+  @Test
+  public void testCheckAccessControlEnforcerSlowness() throws Exception {
+    final long thresholdMs = 10;
+    final String message = FSPermissionChecker.runCheckPermission(() -> {
+      try {
+        Thread.sleep(20);
+      } catch (InterruptedException e) {
+        throw new RuntimeException(e);

Review Comment:
   Sure. Thanks for pointing out the JUnit behavior.



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