Dapeng Sun created SENTRY-1155:
----------------------------------

             Summary: Add waiting time for getMetastoreClient for avoiding 
metastore isn't ready
                 Key: SENTRY-1155
                 URL: https://issues.apache.org/jira/browse/SENTRY-1155
             Project: Sentry
          Issue Type: Bug
            Reporter: Dapeng Sun
            Assignee: Dapeng Sun


For {{TestMetastoreEndToEnd}}, If metastore didn't finish the initialization.  
context.getMetaStoreClient will throw exception. 
{noformat}
HiveMetaStoreClient client = context.getMetaStoreClient(ADMIN1);
{noformat}
We should wait for the initialization of metastore, for example:
{noformat}
    HiveMetaStoreClient client = null;
    for (int i=0; i < 10; i++) {
      try {
        client = context.getMetaStoreClient(ADMIN1);
        break;
      } catch (Throwable e) {
        // ignore
      }
      Thread.sleep(6000);
    }
{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to