You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Jonathan Hsieh (Created) (JIRA)" <ji...@apache.org> on 2011/09/29 23:15:48 UTC
[jira] [Created] (HBASE-4515) User.getCurrent() can cause NPE.
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
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
[jira] [Assigned] (HBASE-4515) User.getCurrent() can cause NPE.
Posted by "Jonathan Hsieh (Assigned) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jonathan Hsieh reassigned HBASE-4515:
-------------------------------------
Assignee: Gary Helmling (was: Jonathan Hsieh)
> 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: Gary Helmling
> 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
[jira] [Commented] (HBASE-4515) User.getCurrent() can cause NPE.
Posted by "Jonathan Hsieh (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13117735#comment-13117735 ]
Jonathan Hsieh commented on HBASE-4515:
---------------------------------------
@Gary I tested your fix and it works for me. Can this be backported to 0.92/0.90.x as well? I need it for the unit tests of HBASE-4377, which I would like to implement and backport as well.
> 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
[jira] [Commented] (HBASE-4515) User.getCurrent() can cause NPE.
Posted by "jiraposter@reviews.apache.org (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13117723#comment-13117723 ]
jiraposter@reviews.apache.org 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 <jo...@cloudera.com>
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
[jira] [Updated] (HBASE-4515) User.getCurrent() can cause NPE.
Posted by "Jonathan Hsieh (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jonathan Hsieh updated HBASE-4515:
----------------------------------
Status: Patch Available (was: Open)
> 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
>
>
> 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
[jira] [Updated] (HBASE-4515) User.getCurrent() can fail to
initialize the current user
Posted by "Gary Helmling (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gary Helmling updated HBASE-4515:
---------------------------------
Resolution: Fixed
Hadoop Flags: Reviewed
Status: Resolved (was: Patch Available)
Committed to 0.90, 0.92 and trunk.
> User.getCurrent() can fail to initialize the current user
> ---------------------------------------------------------
>
> Key: HBASE-4515
> URL: https://issues.apache.org/jira/browse/HBASE-4515
> Project: HBase
> Issue Type: Bug
> Affects Versions: 0.90.4, 0.92.0, 0.94.0
> Reporter: Jonathan Hsieh
> Assignee: Gary Helmling
> Fix For: 0.92.0, 0.94.0, 0.90.5
>
> Attachments: 0001-HBASE-4515-User.getCurrent-can-cause-NPE.patch, HBASE-4515_0.90_final.patch, HBASE-4515_0.92_final.patch, HBASE-4515_trunk.patch, HBASE-4515_trunk_final.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
[jira] [Commented] (HBASE-4515) User.getCurrent() can cause NPE.
Posted by "jiraposter@reviews.apache.org (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13117636#comment-13117636 ]
jiraposter@reviews.apache.org commented on HBASE-4515:
------------------------------------------------------
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/2123/
-----------------------------------------------------------
Review request for hbase and Gary Helmling.
Summary
-------
commit aa319da9896588f97aeeb50a39bc5641ae58d537
Author: Jonathan Hsieh <jo...@cloudera.com>
Date: Thu Sep 29 13:27:22 2011 -0700
HBASE-4515 User.getCurrent() can cause NPE
This addresses bug HBASE-4515.
https://issues.apache.org/jira/browse/HBASE-4515
Diffs
-----
src/main/java/org/apache/hadoop/hbase/security/User.java d90f2c7
src/test/java/org/apache/hadoop/hbase/security/TestUser.java 6e497da
Diff: https://reviews.apache.org/r/2123/diff
Testing
-------
New unit tests passes although the behavior it displays is a bit suspect.
Thanks,
jmhsieh
> 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
>
> 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
[jira] [Updated] (HBASE-4515) User.getCurrent() can fail to
initialize the current user
Posted by "Gary Helmling (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gary Helmling updated HBASE-4515:
---------------------------------
Affects Version/s: 0.90.4
Fix Version/s: 0.90.5
0.94.0
0.92.0
Summary: User.getCurrent() can fail to initialize the current user (was: User.getCurrent() can cause NPE.)
> User.getCurrent() can fail to initialize the current user
> ---------------------------------------------------------
>
> Key: HBASE-4515
> URL: https://issues.apache.org/jira/browse/HBASE-4515
> Project: HBase
> Issue Type: Bug
> Affects Versions: 0.90.4, 0.92.0, 0.94.0
> Reporter: Jonathan Hsieh
> Assignee: Gary Helmling
> Fix For: 0.92.0, 0.94.0, 0.90.5
>
> 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
[jira] [Updated] (HBASE-4515) User.getCurrent() can fail to
initialize the current user
Posted by "Gary Helmling (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gary Helmling updated HBASE-4515:
---------------------------------
Attachment: HBASE-4515_0.90_final.patch
HBASE-4515_0.92_final.patch
HBASE-4515_trunk_final.patch
Patches committed to trunk, 0.92 and 0.90.
> User.getCurrent() can fail to initialize the current user
> ---------------------------------------------------------
>
> Key: HBASE-4515
> URL: https://issues.apache.org/jira/browse/HBASE-4515
> Project: HBase
> Issue Type: Bug
> Affects Versions: 0.90.4, 0.92.0, 0.94.0
> Reporter: Jonathan Hsieh
> Assignee: Gary Helmling
> Fix For: 0.92.0, 0.94.0, 0.90.5
>
> Attachments: 0001-HBASE-4515-User.getCurrent-can-cause-NPE.patch, HBASE-4515_0.90_final.patch, HBASE-4515_0.92_final.patch, HBASE-4515_trunk.patch, HBASE-4515_trunk_final.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
[jira] [Commented] (HBASE-4515) User.getCurrent() can cause NPE.
Posted by "jiraposter@reviews.apache.org (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13117771#comment-13117771 ]
jiraposter@reviews.apache.org commented on HBASE-4515:
------------------------------------------------------
bq. On 2011-09-29 23:08:13, Andrew Purtell wrote:
bq. > IMO, it would be best to avoid letting either a null or NPE escape.
bq.
bq. jmhsieh wrote:
bq. I agree, I just didn't figure out how the value got populated. Gary's posted a patch that avoids the npe/null by logging in and that code worked for me.
bq.
bq. Michael Stack wrote:
bq. Should we cancel this review then?
done.
- jmhsieh
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/2123/#review2190
-----------------------------------------------------------
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 <jo...@cloudera.com>
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: Gary Helmling
> 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
[jira] [Commented] (HBASE-4515) User.getCurrent() can cause NPE.
Posted by "Gary Helmling (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13117688#comment-13117688 ]
Gary Helmling commented on HBASE-4515:
--------------------------------------
I think the key issue here is differences in behavior between non-secure Hadoop's {{UserGroupInformation.getCurrentUGI()}} and secure Hadoop's {{UserGroupInformation.getCurrentUser()}}. In secure Hadoop, if the current user is {{null}}, it will perform an implicit login and use the subject retrieved through that as the current user. In non-secure Hadoop (0.20.2, 0.20-append), the login step is completely separate, so if the current user has not been set, only {{null}} will be returned.
For HBase purposes, I think we should make sure {{User.getCurrent()}} always performs the implicit login for consistent behavior. Let me post an alternate patch that takes that approach and see if it fixes your test problem.
> 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
>
>
> 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
[jira] [Updated] (HBASE-4515) User.getCurrent() can cause NPE.
Posted by "Gary Helmling (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gary Helmling updated HBASE-4515:
---------------------------------
Attachment: HBASE-4515_trunk.patch
Here is an alternate patch that will attempt to perform a UserGroupInformation.login() on non-secure Hadoop if the current user is null.
> 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
[jira] [Commented] (HBASE-4515) User.getCurrent() can cause NPE.
Posted by "jiraposter@reviews.apache.org (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13117760#comment-13117760 ]
jiraposter@reviews.apache.org commented on HBASE-4515:
------------------------------------------------------
bq. On 2011-09-29 23:08:13, Andrew Purtell wrote:
bq. > IMO, it would be best to avoid letting either a null or NPE escape.
bq.
bq. jmhsieh wrote:
bq. I agree, I just didn't figure out how the value got populated. Gary's posted a patch that avoids the npe/null by logging in and that code worked for me.
Should we cancel this review then?
- Michael
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/2123/#review2190
-----------------------------------------------------------
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 <jo...@cloudera.com>
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: Gary Helmling
> 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
[jira] [Commented] (HBASE-4515) User.getCurrent() can fail to
initialize the current user
Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13118657#comment-13118657 ]
Hudson commented on HBASE-4515:
-------------------------------
Integrated in HBase-TRUNK #2275 (See [https://builds.apache.org/job/HBase-TRUNK/2275/])
HBASE-4515 User.getCurrent() can fail to initialize the current user
garyh :
Files :
* /hbase/trunk/CHANGES.txt
* /hbase/trunk/src/main/java/org/apache/hadoop/hbase/security/User.java
* /hbase/trunk/src/test/java/org/apache/hadoop/hbase/security/TestUser.java
> User.getCurrent() can fail to initialize the current user
> ---------------------------------------------------------
>
> Key: HBASE-4515
> URL: https://issues.apache.org/jira/browse/HBASE-4515
> Project: HBase
> Issue Type: Bug
> Affects Versions: 0.90.4, 0.92.0, 0.94.0
> Reporter: Jonathan Hsieh
> Assignee: Gary Helmling
> Fix For: 0.92.0, 0.94.0, 0.90.5
>
> Attachments: 0001-HBASE-4515-User.getCurrent-can-cause-NPE.patch, HBASE-4515_0.90_final.patch, HBASE-4515_0.92_final.patch, HBASE-4515_trunk.patch, HBASE-4515_trunk_final.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
[jira] [Commented] (HBASE-4515) User.getCurrent() can cause NPE.
Posted by "Jonathan Hsieh (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13117623#comment-13117623 ]
Jonathan Hsieh commented on HBASE-4515:
---------------------------------------
A stack trace of the error that I'd like to avoid.
{code}
2011-09-29 11:38:45,823 ERROR [Thread-341] hbase.MiniHBaseCluster(201): Error starting cluster
java.lang.NullPointerException
at org.apache.hadoop.hbase.security.User.getName(User.java:71)
at org.apache.hadoop.hbase.HBaseTestingUtility.getDifferentUser(HBaseTestingUtility.java:1421)
at org.apache.hadoop.hbase.MiniHBaseCluster.init(MiniHBaseCluster.java:191)
at org.apache.hadoop.hbase.MiniHBaseCluster.<init>(MiniHBaseCluster.java:76)
at org.apache.hadoop.hbase.MiniHBaseCluster.<init>(MiniHBaseCluster.java:61)
at org.apache.hadoop.hbase.HBaseTestingUtility.restartHBaseCluster(HBaseTestingUtility.java:505)
at org.apache.hadoop.hbase.util.hbck.TestOfflineMetaRebuild.testMetaRebuild(TestOfflineMetaRebuild.java:306)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.FailOnTimeout$1.run(FailOnTimeout.java:28)
{code}
> 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
>
> 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
[jira] [Updated] (HBASE-4515) User.getCurrent() can cause NPE.
Posted by "Jonathan Hsieh (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jonathan Hsieh updated HBASE-4515:
----------------------------------
Attachment: 0001-HBASE-4515-User.getCurrent-can-cause-NPE.patch
> 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
>
>
> 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
[jira] [Assigned] (HBASE-4515) User.getCurrent() can cause NPE.
Posted by "Jonathan Hsieh (Assigned) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jonathan Hsieh reassigned HBASE-4515:
-------------------------------------
Assignee: Jonathan Hsieh
> 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
>
> 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
[jira] [Commented] (HBASE-4515) User.getCurrent() can cause NPE.
Posted by "Andrew Purtell (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13117914#comment-13117914 ]
Andrew Purtell commented on HBASE-4515:
---------------------------------------
+1 on "HBASE-4515_trunk.patch"
> 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: Gary Helmling
> 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
[jira] [Commented] (HBASE-4515) User.getCurrent() can fail to
initialize the current user
Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13119088#comment-13119088 ]
Hudson commented on HBASE-4515:
-------------------------------
Integrated in HBase-0.92 #37 (See [https://builds.apache.org/job/HBase-0.92/37/])
HBASE-4515 User.getCurrent() can fail to initialize the current user
garyh :
Files :
* /hbase/branches/0.92/CHANGES.txt
* /hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/security/User.java
* /hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/security/TestUser.java
> User.getCurrent() can fail to initialize the current user
> ---------------------------------------------------------
>
> Key: HBASE-4515
> URL: https://issues.apache.org/jira/browse/HBASE-4515
> Project: HBase
> Issue Type: Bug
> Affects Versions: 0.90.4, 0.92.0, 0.94.0
> Reporter: Jonathan Hsieh
> Assignee: Gary Helmling
> Fix For: 0.92.0, 0.94.0, 0.90.5
>
> Attachments: 0001-HBASE-4515-User.getCurrent-can-cause-NPE.patch, HBASE-4515_0.90_final.patch, HBASE-4515_0.92_final.patch, HBASE-4515_trunk.patch, HBASE-4515_trunk_final.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
[jira] [Commented] (HBASE-4515) User.getCurrent() can cause NPE.
Posted by "jiraposter@reviews.apache.org (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13117740#comment-13117740 ]
jiraposter@reviews.apache.org commented on HBASE-4515:
------------------------------------------------------
bq. On 2011-09-29 23:08:13, Andrew Purtell wrote:
bq. > IMO, it would be best to avoid letting either a null or NPE escape.
I agree, I just didn't figure out how the value got populated. Gary's posted a patch that avoids the npe/null by logging in and that code worked for me.
- jmhsieh
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/2123/#review2190
-----------------------------------------------------------
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 <jo...@cloudera.com>
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: Gary Helmling
> 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
[jira] [Commented] (HBASE-4515) User.getCurrent() can cause NPE.
Posted by "Gary Helmling (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-4515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13117861#comment-13117861 ]
Gary Helmling commented on HBASE-4515:
--------------------------------------
I ran the attached patch through the full test suite on trunk. The only test failure was:
{noformat}
Tests in error:
testExistingZnodeBlocksSplitAndWeRollback(org.apache.hadoop.hbase.regionserver.TestSplitTransactionOnCluster)
{noformat}
which seems otherwise flaky and unrelated.
> 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: Gary Helmling
> 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