Duo Zhang commented on HBASE-20169:

OK, so there is a race. Then a simple null check can not solve the problem 
perfectly. It could still happen that the timeoutExecutor is set to null right 
after your null check...

The trick always works here is make timeoutExecutor volatile, and assign it to 
a local variable, and then do the null check and call its method, or just do 
not set it to null...

But I prefer we analysis the shutdown method again to see if we really need to 
call procedureExecutor.stop? BTW the clusterConnection.close is needed as we 
need to interrupt the thread which is accessing meta.


> NPE when calling HBTU.shutdownMiniCluster (TestAssignmentManagerMetrics is 
> flakey)
> ----------------------------------------------------------------------------------
>                 Key: HBASE-20169
>                 URL: https://issues.apache.org/jira/browse/HBASE-20169
>             Project: HBase
>          Issue Type: Bug
>          Components: test
>            Reporter: Duo Zhang
>            Assignee: stack
>            Priority: Major
>         Attachments: HBASE-20169.branch-2.001.patch, 
> HBASE-20169.branch-2.002.patch, HBASE-20169.branch-2.003.patch, 
> HBASE-20169.branch-2.004.patch, HBASE-20169.branch-2.005.patch, 
> HBASE-20169.v0.addendum.patch
> This usually happens when some master or rs has already been down before we 
> calling shutdownMiniCluster.
> See
> https://builds.apache.org/job/HBASE-Flaky-Tests/27223/testReport/junit/org.apache.hadoop.hbase.master/TestAssignmentManagerMetrics/org_apache_hadoop_hbase_master_TestAssignmentManagerMetrics/
> and also
> {noformat}
> java.lang.NullPointerException
>       at 
> org.apache.hadoop.hbase.master.TestAssignmentManagerMetrics.after(TestAssignmentManagerMetrics.java:100)
> java.lang.NullPointerException
>       at 
> org.apache.hadoop.hbase.master.TestRestartCluster.testRetainAssignmentOnRestart(TestRestartCluster.java:156)
> {noformat}

This message was sent by Atlassian JIRA

Reply via email to