[ https://issues.apache.org/jira/browse/HDFS-2948?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Todd Lipcon reopened HDFS-2948: ------------------------------- Oops, this also needs to be fixed on the SBN it appears. Mind if I just commit the same null check to the SBN under this same JIRA issue? {code} diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java b/hadoop-hdfs-project/hadoop-hd index 4e628ce..5c09512 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java @@ -994,7 +994,9 @@ public class NameNode { @Override public void stopStandbyServices() throws IOException { // TODO(HA): Are we guaranteed to be the only active here? - namesystem.stopStandbyServices(); + if (namesystem != null) { + namesystem.stopStandbyServices(); + } } @Override {code} > HA: NN throws NPE during shutdown if it fails to startup > -------------------------------------------------------- > > Key: HDFS-2948 > URL: https://issues.apache.org/jira/browse/HDFS-2948 > Project: Hadoop HDFS > Issue Type: Sub-task > Components: ha, name-node > Affects Versions: HA branch (HDFS-1623) > Reporter: Todd Lipcon > Assignee: Todd Lipcon > Priority: Minor > Fix For: HA branch (HDFS-1623) > > Attachments: hdfs-2948.txt > > > Last night's nightly build had a bunch of NPEs thrown in NameNode.stop. Not > sure which patch introduced the issue, but the problem is that > NameNode.stop() is called if an exception is thrown during startup. If the > exception is thrown before the namesystem is created, then > NameNode.namesystem is null, and {{namesystem.stop}} throws 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