Uploaded image for project: 'Sentry'
  1. Sentry
  2. SENTRY-1155

Add waiting time for getMetastoreClient for avoiding metastore isn't ready

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.0
    • Fix Version/s: 1.7.0
    • Component/s: None
    • Labels:
      None

      Description

      For TestMetastoreEndToEnd, If metastore didn't finish the initialization. context.getMetaStoreClient will throw exception.

      HiveMetaStoreClient client = context.getMetaStoreClient(ADMIN1);
      

      We should wait for the initialization of metastore, for example:

          HiveMetaStoreClient client = null;
          for (int i=0; i < 10; i++) {
            try {
              client = context.getMetaStoreClient(ADMIN1);
              break;
            } catch (Throwable e) {
              // ignore
            }
            Thread.sleep(6000);
          }
      

        Attachments

        1. SENTRY-1155.002.patch
          2 kB
          Dapeng Sun
        2. SENTRY-1155.001.patch
          1 kB
          Dapeng Sun

          Activity

            People

            • Assignee:
              dapengsun Dapeng Sun
              Reporter:
              dapengsun Dapeng Sun
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: