[ 
https://issues.apache.org/jira/browse/HBASE-20169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16439385#comment-16439385
 ] 

Chia-Ping Tsai commented on HBASE-20169:
----------------------------------------

{quote} if (procedureExecutor != null) {
      
configurationManager.deregisterObserver(procedureExecutor.getEnvironment());
      procedureExecutor.getEnvironment().getRemoteDispatcher().stop();
      procedureExecutor.stop();
      procedureExecutor.join();
      procedureExecutor = null;
    }{quote}
That (#join) is executed by the first thread I have mentioned. The second 
thread is the test thread used to do the @afterClass
{code:java}
TestAssignmentManagerMetrics classs

@AfterClass
public static void after() throws Exception {
  LOG.info("AFTER {} <= IS THIS NULL?", TEST_UTIL);
  TEST_UTIL.shutdownMiniCluster();  // here
}{code}
The JVMClusterUtil#shutdown invoked by TEST_UTIL#shutdownMiniCluster calls the 
HMaster#shutdown and that execution of procedureExecutor#stop ensues.
{code:java}
JVMClusterUtil class

public static void shutdown(final List<MasterThread> masters,
    final List<RegionServerThread> regionservers) {
  LOG.debug("Shutting down HBase Cluster");
  if (masters != null) {
    ...
    // Do active after.
    if (activeMaster != null) {
      try {
        activeMaster.master.shutdown();  // here
      } catch (IOException e) {
        LOG.error("Exception occurred in HMaster.shutdown()", e);
      }
    }
  }{code}
{code:java}
HMaster class

public void shutdown() throws IOException {
  ...
  // Stop the procedure executor. Will stop any ongoing assign, unassign, 
server crash etc.,
  // processing so we can go down.
  if (this.procedureExecutor != null) {
    this.procedureExecutor.stop();  // here
  }{code}
 

> 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
> http://104.198.223.121:8080/job/HBASE-Flaky-Tests/34873/testReport/junit/org.apache.hadoop.hbase.master/TestRestartCluster/testRetainAssignmentOnRestart/
> {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
(v7.6.3#76005)

Reply via email to