You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sentry.apache.org by "Hadoop QA (JIRA)" <ji...@apache.org> on 2017/08/14 19:05:00 UTC
[jira] [Commented] (SENTRY-1881) PrivilegeOperatePersistence throws
wrong type of exceptions
[ https://issues.apache.org/jira/browse/SENTRY-1881?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16126236#comment-16126236 ]
Hadoop QA commented on SENTRY-1881:
-----------------------------------
Here are the results of testing the latest attachment
https://issues.apache.org/jira/secure/attachment/12881574/SENTRY-1881.01.patch against master.
{color:red}Overall:{color} -1 due to an error
{color:red}ERROR:{color} failed to build with patch (exit code 1)
Console output: https://builds.apache.org/job/PreCommit-SENTRY-Build/3156/console
This message is automatically generated.
> PrivilegeOperatePersistence throws wrong type of exceptions
> -----------------------------------------------------------
>
> Key: SENTRY-1881
> URL: https://issues.apache.org/jira/browse/SENTRY-1881
> Project: Sentry
> Issue Type: New Feature
> Components: Sentry
> Affects Versions: 1.8.0, 2.0.0
> Reporter: Alexander Kolbasov
> Assignee: Sergio Peña
> Attachments: SENTRY-1881.01.patch
>
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> The PrivilegeOperatePersistenc class uses wrong exceptions to throw, e.g.:
> {code}
> private BitFieldAction getAction(String component, String name) {
> BitFieldActionFactory actionFactory = getActionFactory(component);
> BitFieldAction action = actionFactory.getActionByName(name);
> if (action == null) {
> throw new RuntimeException("can't get BitFieldAction for name:" + name);
> }
> return action;
> }
> {code}
> Notice that it throws RuntimeException (which is a completely wrong exception to throw here). The problem is that these exceptions are retried at the TransactionManager level and never succeed so we are just waisting time. This particular bit is triggered by a test {{org.apache.sentry.provider.db.generic.service.thrift.TestAuditLogForSentryGenericService}} and we get the following exception which is retried many times:
> {code}
> java.lang.RuntimeException: can't get BitFieldAction for name:invalidaction
> at org.apache.sentry.provider.db.generic.service.persistent.PrivilegeOperatePersistence.getAc
> tion(PrivilegeOperatePersistence.java:523)
> at org.apache.sentry.provider.db.generic.service.persistent.PrivilegeOperatePersistence.grant
> RolePartial(PrivilegeOperatePersistence.java:191)
> at org.apache.sentry.provider.db.generic.service.persistent.PrivilegeOperatePersistence.grant
> Privilege(PrivilegeOperatePersistence.java:181)
> at org.apache.sentry.provider.db.generic.service.persistent.DelegateSentryStore$1.execute(Del
> egateSentryStore.java:132)
> at org.apache.sentry.provider.db.service.persistent.TransactionManager.executeTransaction(Tra
> nsactionManager.java:123)
> at org.apache.sentry.provider.db.service.persistent.TransactionManager$1.call(TransactionMana
> ger.java:192)
> at org.apache.sentry.provider.db.service.persistent.TransactionManager$ExponentialBackoff.exe
> cute(TransactionManager.java:233)
> at org.apache.sentry.provider.db.service.persistent.TransactionManager.executeTransactionWith
> Retry(TransactionManager.java:188)
> at org.apache.sentry.provider.db.generic.service.persistent.DelegateSentryStore.alterRoleGran
> tPrivilege(DelegateSentryStore.java:119)
> at org.apache.sentry.provider.db.generic.service.thrift.SentryGenericPolicyProcessor$5.handle
> (SentryGenericPolicyProcessor.java:435)
> at org.apache.sentry.provider.db.generic.service.thrift.SentryGenericPolicyProcessor.requestH
> andle(SentryGenericPolicyProcessor.java:183)
> at org.apache.sentry.provider.db.generic.service.thrift.SentryGenericPolicyProcessor.alter_se
> ntry_role_grant_privilege(SentryGenericPolicyProcessor.java:431)
> at org.apache.sentry.provider.db.generic.service.thrift.SentryGenericPolicyService$Processor$
> alter_sentry_role_grant_privilege.getResult(SentryGenericPolicyService.java:877)
> at org.apache.sentry.provider.db.generic.service.thrift.SentryGenericPolicyService$Processor$
> alter_sentry_role_grant_privilege.getResult(SentryGenericPolicyService.java:862)
> at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
> at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
> at org.apache.sentry.provider.db.generic.service.thrift.SentryGenericPolicyProcessorWrapper.p
> rocess(SentryGenericPolicyProcessorWrapper.java:37)
> at org.apache.thrift.TMultiplexedProcessor.process(TMultiplexedProcessor.java:123)
> at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:286)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> {code)
> Not only it is wrong, but also it sometimes triggers test failures because we may retry for longer then the test allocated time. We should use Sentry exceptions which are not retried by TransactionManager instead.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)