> On April 14, 2017, 12:57 a.m., Alexander Kolbasov wrote:
> > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryService.java
> > Line 196 (original), 186 (patched)
> > <https://reviews.apache.org/r/58221/diff/9/?file=1692270#file1692270line198>
> >
> >     Can you clarify why it should be started in constructor and why would 
> > tests fail otherwise?
> 
> Na Li wrote:
>     the test TestDbSentryOnFailureHookLoading setup calls 
> AbstractTestWithDbProvider.createContext(), which expects the context to be 
> not null after creating SentryService and before calling 
> SentryService.start(). If we don't schedule the cleaner in constructor, we 
> will fail at assumeNotNull(context); if we schedul the cleaner in 
> constructor, it does not fail at assumeNotNull(context); 
>     
>     AbstractTestWithDbProvider.createContext()
>     {
>     ...
>         assumeNotNull(context);
>         context = AbstractTestWithHiveServer.createContext(properties);
>         policyFile
>             .setUserGroupMapping(StaticUserGroup.getStaticMapping())
>             .write(context.getPolicyFile(), policyFilePath);
>     
>         startSentryService();
>         ...
>     }
> 
> Alexander Kolbasov wrote:
>     That's rather weird - the context is created right after you verify that 
> it is not null. How can that work? And how does the cleaner service affects 
> this strange assert?

Now, it is not started at constructor. So the issue is removed.


> On April 14, 2017, 12:57 a.m., Alexander Kolbasov wrote:
> > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryService.java
> > Lines 425 (patched)
> > <https://reviews.apache.org/r/58221/diff/9/?file=1692270#file1692270line454>
> >
> >     The code uses synchronized() on both, so the comment isn't quite right 
> > - it would handle concurrent calls to start()/stop() - not that it is 
> > needed.
> 
> Na Li wrote:
>     the synchronized is orignal. You mentioned if multiple threads accese it 
> at the same time, since we don't protect variables, it is still not thread 
> safe.
> 
> Na Li wrote:
>     do you want me to remove the comment?
> 
> Alexander Kolbasov wrote:
>     It may be better to update it - the current comment contradicts the code.

I have removed the comment that it is not thread safe


- Na


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


On April 18, 2017, 3:46 a.m., Na Li wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/58221/
> -----------------------------------------------------------
> 
> (Updated April 18, 2017, 3:46 a.m.)
> 
> 
> Review request for sentry, Alexander Kolbasov, Hao Hao, kalyan kumar 
> kalvagadda, and Sergio Pena.
> 
> 
> Repository: sentry
> 
> 
> Description
> -------
> 
> SENTRY-1649 move HMS follower to runServer
> 
> 
> Diffs
> -----
> 
>   
> sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java
>  16676fb 
>   
> sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryService.java
>  132db63 
> 
> 
> Diff: https://reviews.apache.org/r/58221/diff/15/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Na Li
> 
>

Reply via email to