Bladeren bron

Amend HDFS-2948. NN throws NPE during shutdown if it fails to startup

Previous patch missed the case where the NN fails to start up when it's starting in standby state.


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-1623@1244813 13f79535-47bb-0310-9956-ffa450edef68
Todd Lipcon 13 jaren geleden
bovenliggende
commit
0663b51ed4

+ 3 - 1
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java

@@ -995,7 +995,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