You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2018/10/02 17:34:00 UTC

[jira] [Commented] (IMPALA-7520) NPE in SentryProxy

    [ https://issues.apache.org/jira/browse/IMPALA-7520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16635858#comment-16635858 ] 

ASF subversion and git services commented on IMPALA-7520:
---------------------------------------------------------

Commit de39b0331e1e000162a93bfb90888e2dfbadcd13 in impala's branch refs/heads/master from [~fredyw]
[ https://git-wip-us.apache.org/repos/asf?p=impala.git;h=de39b03 ]

IMPALA-7520: Fix NullPointerException in SentryProxy

Prior to this patch, the code in SentryProxy could throw a
NullPointerException when trying to retrieve a set of privileges for a
given role name. I was able to manually reproduce the issue by doing
the following steps:

1. Get all Sentry role privileges: [a, b] --> in SentryProxy
2. Add a sleep statement before getting all Sentry roles --> in SentryProxy
3. Add a new Sentry role: [c] --> Externally via Sentry CLI
4. Get all Sentry roles: [a, b, c] --> in SentryProxy
   Role c was added in step 3.
5. Get Sentry role privileges for role c: NPE --> in SentryProxy

The fix is to add a null guard when retrieving Sentry privileges for a
given role name and let the new role get updated in the next Sentry
refresh.

Testing:
- Ran all FE tests
- Ran all authorization E2E tests
- Manually tested it by temporarily modifying the SentryProxy code and
  did not see the NullPointerException

Change-Id: I36af840056a4d037fb5c7b1d9a167c0eb8526a11
Reviewed-on: http://gerrit.cloudera.org:8080/11552
Reviewed-by: Fredy Wijaya <fw...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


> NPE in SentryProxy
> ------------------
>
>                 Key: IMPALA-7520
>                 URL: https://issues.apache.org/jira/browse/IMPALA-7520
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Frontend
>    Affects Versions: Impala 3.1.0
>            Reporter: Adam Holley
>            Assignee: Fredy Wijaya
>            Priority: Major
>             Fix For: Impala 3.1.0
>
>
> In SentryProxy.refreshPrivilegesInCache(), the call to allPrincipalPrivileges.get(principal.getName()) is sometimes returning null.
> {noformat}
> java.lang.NullPointerException
>     at org.apache.impala.util.SentryProxy$PolicyReader.refreshPrivilegesInCatalog(SentryProxy.java:245)
>     at org.apache.impala.util.SentryProxy$PolicyReader.refreshRolePrivileges(SentryProxy.java:197)
>     at org.apache.impala.util.SentryProxy$PolicyReader.run(SentryProxy.java:139)
>     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>      at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
>      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
>     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
>     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>     at java.lang.Thread.run(Thread.java:748)
> {noformat}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org