Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C01EA95E1 for ; Thu, 29 Sep 2011 21:44:09 +0000 (UTC) Received: (qmail 4856 invoked by uid 500); 29 Sep 2011 21:44:09 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 4761 invoked by uid 500); 29 Sep 2011 21:44:09 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 4711 invoked by uid 99); 29 Sep 2011 21:44:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Sep 2011 21:44:09 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Sep 2011 21:44:07 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id A27A42A12B4 for ; Thu, 29 Sep 2011 21:43:45 +0000 (UTC) Date: Thu, 29 Sep 2011 21:43:45 +0000 (UTC) From: "Jonathan Hsieh (Updated) (JIRA)" To: issues@hbase.apache.org Message-ID: <7634509.9245.1317332625667.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <966663480.9126.1317330948043.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (HBASE-4515) User.getCurrent() can cause NPE. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on 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