Fredy Wijaya has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/11552


Change subject: IMPALA-7520: Fix NullPointerException in SentryProxy
......................................................................

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:
- Manually tested it by temporarily modifying the SentryProxy code and
  did not see the NullPointerException

Change-Id: I36af840056a4d037fb5c7b1d9a167c0eb8526a11
---
M fe/src/main/java/org/apache/impala/util/SentryProxy.java
1 file changed, 5 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/52/11552/2
--
To view, visit http://gerrit.cloudera.org:8080/11552
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I36af840056a4d037fb5c7b1d9a167c0eb8526a11
Gerrit-Change-Number: 11552
Gerrit-PatchSet: 2
Gerrit-Owner: Fredy Wijaya <fwij...@cloudera.com>

Reply via email to