You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sentry.apache.org by Dapeng Sun <da...@intel.com> on 2016/03/22 08:40:37 UTC

Review Request 45153: SENTRY-1155: Add waiting time for getMetastoreClient for avoiding metastore isn't ready

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/45153/
-----------------------------------------------------------

Review request for sentry and Colin Ma.


Bugs: SENTRY-1155
    https://issues.apache.org/jira/browse/SENTRY-1155


Repository: sentry


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);
    }


Diffs
-----

  sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/metastore/TestMetastoreEndToEnd.java 98ec814 

Diff: https://reviews.apache.org/r/45153/diff/


Testing
-------


Thanks,

Dapeng Sun


Re: Review Request 45153: SENTRY-1155: Add waiting time for getMetastoreClient for avoiding metastore isn't ready

Posted by Colin Ma <ju...@intel.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/45153/#review124755
-----------------------------------------------------------



I think the retry should be added to context.getMetaStoreClient(), and comments should be added to describe why retry is needed here.

- Colin Ma


On March 22, 2016, 7:40 a.m., Dapeng Sun wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45153/
> -----------------------------------------------------------
> 
> (Updated March 22, 2016, 7:40 a.m.)
> 
> 
> Review request for sentry and Colin Ma.
> 
> 
> Bugs: SENTRY-1155
>     https://issues.apache.org/jira/browse/SENTRY-1155
> 
> 
> Repository: sentry
> 
> 
> 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);
>     }
> 
> 
> Diffs
> -----
> 
>   sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/metastore/TestMetastoreEndToEnd.java 98ec814 
> 
> Diff: https://reviews.apache.org/r/45153/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Dapeng Sun
> 
>


Re: Review Request 45153: SENTRY-1155: Add waiting time for getMetastoreClient for avoiding metastore isn't ready

Posted by Anne Yu <an...@cloudera.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/45153/#review126957
-----------------------------------------------------------


Ship it!




Ship It!

- Anne Yu


On March 22, 2016, 10:55 a.m., Dapeng Sun wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45153/
> -----------------------------------------------------------
> 
> (Updated March 22, 2016, 10:55 a.m.)
> 
> 
> Review request for sentry and Colin Ma.
> 
> 
> Bugs: SENTRY-1155
>     https://issues.apache.org/jira/browse/SENTRY-1155
> 
> 
> Repository: sentry
> 
> 
> 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);
>     }
> 
> 
> Diffs
> -----
> 
>   sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/Context.java 2e508d6 
> 
> Diff: https://reviews.apache.org/r/45153/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Dapeng Sun
> 
>


Re: Review Request 45153: SENTRY-1155: Add waiting time for getMetastoreClient for avoiding metastore isn't ready

Posted by Colin Ma <ju...@intel.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/45153/#review124939
-----------------------------------------------------------




sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/Context.java (line 265)
<https://reviews.apache.org/r/45153/#comment187642>

    I think the try-catch should be put here.


- Colin Ma


On March 22, 2016, 10:55 a.m., Dapeng Sun wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45153/
> -----------------------------------------------------------
> 
> (Updated March 22, 2016, 10:55 a.m.)
> 
> 
> Review request for sentry and Colin Ma.
> 
> 
> Bugs: SENTRY-1155
>     https://issues.apache.org/jira/browse/SENTRY-1155
> 
> 
> Repository: sentry
> 
> 
> 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);
>     }
> 
> 
> Diffs
> -----
> 
>   sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/Context.java 2e508d6 
> 
> Diff: https://reviews.apache.org/r/45153/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Dapeng Sun
> 
>


Re: Review Request 45153: SENTRY-1155: Add waiting time for getMetastoreClient for avoiding metastore isn't ready

Posted by Dapeng Sun <da...@intel.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/45153/
-----------------------------------------------------------

(Updated 三月 22, 2016, 6:55 p.m.)


Review request for sentry and Colin Ma.


Changes
-------

Update patch according comments


Bugs: SENTRY-1155
    https://issues.apache.org/jira/browse/SENTRY-1155


Repository: sentry


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);
    }


Diffs (updated)
-----

  sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/Context.java 2e508d6 

Diff: https://reviews.apache.org/r/45153/diff/


Testing
-------


Thanks,

Dapeng Sun