[ 
https://issues.apache.org/jira/browse/HADOOP-17608?focusedWorklogId=573741&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-573741
 ]

ASF GitHub Bot logged work on HADOOP-17608:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 29/Mar/21 21:44
            Start Date: 29/Mar/21 21:44
    Worklog Time Spent: 10m 
      Work Description: xiaoyuyao commented on a change in pull request #2828:
URL: https://github.com/apache/hadoop/pull/2828#discussion_r603483652



##########
File path: 
hadoop-common-project/hadoop-kms/src/test/java/org/apache/hadoop/crypto/key/kms/server/TestKMS.java
##########
@@ -550,7 +550,7 @@ public Void call() throws Exception {
           threadGroup.enumerate(threads);

Review comment:
       Thanks @aajisaka  for reporting the issue and the fix. 
   
   I think the problem is Line 550: ThreadGroup#enumerate does not provide a 
reliable way to get all the threads based on the JDK document. This is 
problematic especially if the threads array is not big enough to hold all the 
threads returned, the extra will be silently skipped. In the case of the 
reloader thread is skipped, we will have a reloaderThead as null for NPE. The 
proposed fix may not completely solve the problem. 
   
   I would suggest we use Apache common ThreadUtils.findThreadsByName to 
replace the code Line 547-563, which simplify the code with better handling of 
this case to avoid NPE. 
   
   ```suggestion
    Collection<Thread> result =
                 ThreadUtils.findThreadsByName(SSL_RELOADER_THREAD_NAME);
             Assert.assertEquals(1, result.size());
             Assert.assertTrue("Reloader is not alive",
                 result.iterator().next().isAlive());
   ```




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

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 573741)
    Time Spent: 0.5h  (was: 20m)

> TestKMS is flaky
> ----------------
>
>                 Key: HADOOP-17608
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17608
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: kms
>            Reporter: Akira Ajisaka
>            Assignee: Akira Ajisaka
>            Priority: Major
>              Labels: flaky-test, pull-request-available
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> [https://ci-hadoop.apache.org/job/hadoop-qbt-trunk-java8-linux-x86_64/460/artifact/out/patch-unit-hadoop-common-project_hadoop-kms.txt]
> The following https tests are flaky:
>  * testStartStopHttpsPseudo
>  * testStartStopHttpsKerberos
>  * testDelegationTokensOpsHttpsPseudo
> {noformat}
> [ERROR] 
> testStartStopHttpsPseudo(org.apache.hadoop.crypto.key.kms.server.TestKMS)  
> Time elapsed: 1.354 s  <<< ERROR!
> java.lang.NullPointerException
>       at 
> org.apache.hadoop.crypto.key.kms.server.TestKMS$1.call(TestKMS.java:553)
>       at 
> org.apache.hadoop.crypto.key.kms.server.TestKMS$1.call(TestKMS.java:534)
>       at 
> org.apache.hadoop.crypto.key.kms.server.TestKMS.runServer(TestKMS.java:258)
>       at 
> org.apache.hadoop.crypto.key.kms.server.TestKMS.runServer(TestKMS.java:235)
>       at 
> org.apache.hadoop.crypto.key.kms.server.TestKMS.runServer(TestKMS.java:230)
>       at 
> org.apache.hadoop.crypto.key.kms.server.TestKMS.testStartStop(TestKMS.java:534)
>       at 
> org.apache.hadoop.crypto.key.kms.server.TestKMS.testStartStopHttpsPseudo(TestKMS.java:634){noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to