You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "ConfX (Jira)" <ji...@apache.org> on 2023/07/18 16:23:00 UTC

[jira] [Created] (HDFS-17100) Group.GroupCacheLoader does not properly throw Exception with message

ConfX created HDFS-17100:
----------------------------

             Summary: Group.GroupCacheLoader does not properly throw Exception with message
                 Key: HDFS-17100
                 URL: https://issues.apache.org/jira/browse/HDFS-17100
             Project: Hadoop HDFS
          Issue Type: Bug
            Reporter: ConfX
         Attachments: reproduce.sh

h2. What happened?

Got an {{IllegalArgumentException}} without message enclosed in {{ExceptionInInitializerError}} when trying to
h2. Where's the bug?

In the constructor of {{Group.GroupCacheLoader}} it attempts to instantiate a {{{}ThreadPoolExecutor{}}}:
{noformat}
ThreadPoolExecutor parentExecutor =  new ThreadPoolExecutor(
        reloadGroupsThreadCount,
        reloadGroupsThreadCount,
        60,
        TimeUnit.SECONDS,
        new LinkedBlockingQueue<>(),
        threadFactory);{noformat}
The parameters here can be invalid, e.g., {{{}reloadGroupsthreadCount < 0{}}}. However, {{ThreadPoolExecutor}} does not throw any exception with debugging information and {{GroupCacheLoader}} also does not handle the exception properly by adding instructions.
h2. How to reproduce?

(1) set {{hadoop.security.groups.cache.background.reload}} to {{true}} and {{hadoop.security.groups.cache.background.reload.threads}} to {{-781297741}}
(2) run {{org.apache.hadoop.hdfs.TestDataTransferProtocol#testDataTransferProtocol}}
h2. Stacktrace
{noformat}
java.lang.ExceptionInInitializerError
    at org.apache.hadoop.hdfs.MiniDFSCluster.initNameNodeConf(MiniDFSCluster.java:1268)
    at org.apache.hadoop.hdfs.MiniDFSCluster.configureNameService(MiniDFSCluster.java:1089)
    at org.apache.hadoop.hdfs.MiniDFSCluster.createNameNodesAndSetConf(MiniDFSCluster.java:1016)
    at org.apache.hadoop.hdfs.MiniDFSCluster.initMiniDFSCluster(MiniDFSCluster.java:948)
    at org.apache.hadoop.hdfs.MiniDFSCluster.<init>(MiniDFSCluster.java:576)
    at org.apache.hadoop.hdfs.MiniDFSCluster$Builder.build(MiniDFSCluster.java:518)
    at org.apache.hadoop.hdfs.TestDataTransferProtocol.testDataTransferProtocol(TestDataTransferProtocol.java:346)
...
Caused by: java.lang.IllegalArgumentException
    at java.base/java.util.concurrent.ThreadPoolExecutor.<init>(ThreadPoolExecutor.java:1293)
    at java.base/java.util.concurrent.ThreadPoolExecutor.<init>(ThreadPoolExecutor.java:1215)
    at org.apache.hadoop.security.Groups$GroupCacheLoader.<init>(Groups.java:285)
    at org.apache.hadoop.security.Groups.<init>(Groups.java:139)
    at org.apache.hadoop.security.Groups.<init>(Groups.java:102)
    at org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Groups.java:451)
    at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:338)
    at org.apache.hadoop.security.UserGroupInformation.ensureInitialized(UserGroupInformation.java:300)
    at org.apache.hadoop.security.UserGroupInformation.isAuthenticationMethodEnabled(UserGroupInformation.java:395)
    at org.apache.hadoop.security.UserGroupInformation.isSecurityEnabled(UserGroupInformation.java:389)
    at org.apache.hadoop.hdfs.server.common.Util.<clinit>(Util.java:77)
...{noformat}
For an easy reproduction, run the reproduce.sh in the attachment. We are happy to provide a patch if this issue is confirmed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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