----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/27846/#review60726 -----------------------------------------------------------
sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java <https://reviews.apache.org/r/27846/#comment102110> Should exitRequired be an AtomicBoolean so that you don't we don't hang waiting for the lock if exit() is called? It adds another lock so maybe no... sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java <https://reviews.apache.org/r/27846/#comment102111> Do you need this? I don't see how run could ever be executed concurrently. sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java <https://reviews.apache.org/r/27846/#comment102103> You need to worry about spurious wakups from the condition variable. I think this should be something like: while (currentNotifies < NOTIFY_THRESHOLD && !exit) { try { a.wait(); } catch (InterruptedException) {} } notificationCount = 0; //unlock doDeletion(); Then notify every time there is a deletion. sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java <https://reviews.apache.org/r/27846/#comment102112> If this throws an exception the thread will exit. Might be better to log an error instead. sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java <https://reviews.apache.org/r/27846/#comment102108> I think the notification is an implementation detail. Really, this is incDeletionCount() and internally we do a notify. sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java <https://reviews.apache.org/r/27846/#comment102109> form sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java <https://reviews.apache.org/r/27846/#comment102107> Comment on whether it is safe to call exit() multiple times. sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java <https://reviews.apache.org/r/27846/#comment102105> Always put lock/unlock in try/finally blocks - Lenni Kuff On Nov. 11, 2014, 12:22 a.m., Mike Yoder wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/27846/ > ----------------------------------------------------------- > > (Updated Nov. 11, 2014, 12:22 a.m.) > > > Review request for sentry. > > > Bugs: SENTRY-140 > https://issues.apache.org/jira/browse/SENTRY-140 > > > Repository: sentry > > > Description > ------- > > Due to the M-to-N relationship of roles to privileges, when a role is removed > from a privilege (or vice versa) that privilege is not deleted from the > database. > > This fix introduces a thread that periodically (currently, once every 10 > times a role and a privilege are disassociated) runs a SQL query that > searches for all orphaned privileges and deletes them. > > > Diffs > ----- > > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java > f6699d2 > > sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java > 2e829d6 > > Diff: https://reviews.apache.org/r/27846/diff/ > > > Testing > ------- > > Wrote a test case; local testing. > > > Thanks, > > Mike Yoder > >
