[
https://issues.apache.org/jira/browse/HBASE-4515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13117723#comment-13117723
]
[email protected] commented on HBASE-4515:
------------------------------------------------------
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/2123/#review2190
-----------------------------------------------------------
IMO, it would be best to avoid letting either a null or NPE escape.
- Andrew
On 2011-09-29 21:41:46, jmhsieh wrote:
bq.
bq. -----------------------------------------------------------
bq. This is an automatically generated e-mail. To reply, visit:
bq. https://reviews.apache.org/r/2123/
bq. -----------------------------------------------------------
bq.
bq. (Updated 2011-09-29 21:41:46)
bq.
bq.
bq. Review request for hbase and Gary Helmling.
bq.
bq.
bq. Summary
bq. -------
bq.
bq. commit aa319da9896588f97aeeb50a39bc5641ae58d537
bq. Author: Jonathan Hsieh <[email protected]>
bq. Date: Thu Sep 29 13:27:22 2011 -0700
bq.
bq. HBASE-4515 User.getCurrent() can cause NPE
bq.
bq.
bq. This addresses bug HBASE-4515.
bq. https://issues.apache.org/jira/browse/HBASE-4515
bq.
bq.
bq. Diffs
bq. -----
bq.
bq. src/main/java/org/apache/hadoop/hbase/security/User.java d90f2c7
bq. src/test/java/org/apache/hadoop/hbase/security/TestUser.java 6e497da
bq.
bq. Diff: https://reviews.apache.org/r/2123/diff
bq.
bq.
bq. Testing
bq. -------
bq.
bq. New unit tests passes although the behavior it displays is a bit suspect.
bq.
bq.
bq. Thanks,
bq.
bq. jmhsieh
bq.
bq.
> User.getCurrent() can cause NPE.
> --------------------------------
>
> Key: HBASE-4515
> URL: https://issues.apache.org/jira/browse/HBASE-4515
> Project: HBase
> Issue Type: Bug
> Affects Versions: 0.92.0, 0.94.0
> Reporter: Jonathan Hsieh
> Assignee: Jonathan Hsieh
> Attachments: 0001-HBASE-4515-User.getCurrent-can-cause-NPE.patch,
> HBASE-4515_trunk.patch
>
>
> When testing with miniclusters that shutdown and are restarted, sometimes a
> call to User.getCurrent().getName() NPEs when attempting to restart hbase.
> Oddly this happens consistently on particular branches and not on others. I
> don't know or understand why this happens but it has something to do with the
> getCurrentUGI call in o.a.h.h.security.User.HadoopUser sometimes returning
> null and sometimes returning data.
> {code}
> private HadoopUser() {
> try {
> ugi = (UserGroupInformation) callStatic("getCurrentUGI");
> if (ugi == null) {
> LOG.warn("Although successfully retrieved UserGroupInformation"
> + " it was null!");
> }
> } catch (RuntimeException re) {
> {code}
> This patch essentially is a workaround -- it propagates the null so that
> clients can check and avoid the NPE.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira