cnauroth commented on code in PR #5268:
URL: https://github.com/apache/hadoop/pull/5268#discussion_r1060859919
##########
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:
Is it necessary for this to use half? If so, can you describe why in this
comment?
##########
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:
I suggest adding `Thread.currentThread().interrupt();` before throwing. It
shouldn't matter much in practice, but JUnit runner threads have some strange
behavior when interrupted status is not restored as expected.
--
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]