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

Jean-Daniel Cryans commented on HBASE-423:
------------------------------------------

Isn't the call on HConnectionManager.deleteConnectionInfo() in the tearDown of 
HBaseClusterTestCase enough? I tried adding a boolean called acceptingRequests 
in HCM that is checked like this :

{code}
public static HConnection getConnection(HBaseConfiguration conf) {
    TableServers connection = null;
    if(acceptingRequests) {
      
      synchronized (HBASE_INSTANCES) {
        String instanceName = conf.get(HBASE_DIR);
        connection = HBASE_INSTANCES.get(instanceName);
        if (connection == null) {
          connection = new TableServers(conf);
          HBASE_INSTANCES.put(instanceName, connection);
        }
      }
    }
    return connection;
  }
{code}

and I think I saw that each tests took 1 second less. 

> Test cases need a mechanism to tell HConnectionManager to shutdown
> ------------------------------------------------------------------
>
>                 Key: HBASE-423
>                 URL: https://issues.apache.org/jira/browse/HBASE-423
>             Project: Hadoop HBase
>          Issue Type: Test
>          Components: client
>            Reporter: Jim Kellerman
>            Assignee: Jean-Daniel Cryans
>
> One of the reason many test cases take so long is that HConnectionManager 
> continues trying to refind tables, meta and root region even when the test is 
> done but has not completely shut down yet.
> The test case should be able to call the connection manager and tell it to 
> shutdown, meaning:
> - release all references (clear out all its maps)
> - do not accept any new requests
> - if any requests are in progress, abort them.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to