[ https://issues.apache.org/jira/browse/HDFS-14704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16900871#comment-16900871 ]
xuzq commented on HDFS-14704: ----------------------------- Thanks [~crh]. # I think we should do check in createNamenodeHeartbeatService(), because the method createLocalNamenodeHeartbeatService may be create NamenodeHeartbeatService too. # If NsId is null, ServiceInit in NamenodeHeartbeatService will do somethings, like blew, and it will throw exception in some case. About NsId can be null, do you have some ideas? {code:java} if (nsId == null) { nsId = DFSUtil.getOnlyNameServiceIdOrNull(conf); if (nsId == null) { String errorString = "Unable to determine the name service ID."; String[] dfsNames = conf.getStrings(DFS_NAMESERVICES); if ((dfsNames != null) && (dfsNames.length > 1)) { errorString = "Unable to determine the name service ID. " + "This is an HA configuration with multiple name services " + "configured. " + DFS_NAMESERVICES + " is set to " + Arrays.toString(dfsNames) + ". Please re-run with the -ns option."; } throw new IllegalArgumentException(errorString); } } assert nsId != null; {code} > RBF: NnId should not be null in NamenodeHeartbeatService > -------------------------------------------------------- > > Key: HDFS-14704 > URL: https://issues.apache.org/jira/browse/HDFS-14704 > Project: Hadoop HDFS > Issue Type: Sub-task > Components: rbf > Reporter: xuzq > Assignee: xuzq > Priority: Major > Attachments: HDFS-14704-trunk-001.patch > > > NnId should not be null in NamenodeHeartbeatService. > If NnId is null, it will also print the error message like: > {code:java} > 2019-08-06 10:38:07,455 ERROR router.NamenodeHeartbeatService > (NamenodeHeartbeatService.java:updateState(229)) - Unhandled exception > updating NN registration for ns1:null > java.lang.NullPointerException > at > org.apache.hadoop.hdfs.federation.protocol.proto.HdfsServerFederationProtos$NamenodeMembershipRecordProto$Builder.setServiceAddress(HdfsServerFederationProtos.java:3831) > at > org.apache.hadoop.hdfs.server.federation.store.records.impl.pb.MembershipStatePBImpl.setServiceAddress(MembershipStatePBImpl.java:119) > at > org.apache.hadoop.hdfs.server.federation.store.records.MembershipState.newInstance(MembershipState.java:108) > at > org.apache.hadoop.hdfs.server.federation.resolver.MembershipNamenodeResolver.registerNamenode(MembershipNamenodeResolver.java:267) > at > org.apache.hadoop.hdfs.server.federation.router.NamenodeHeartbeatService.updateState(NamenodeHeartbeatService.java:223) > at > org.apache.hadoop.hdfs.server.federation.router.NamenodeHeartbeatService.periodicInvoke(NamenodeHeartbeatService.java:159) > at > org.apache.hadoop.hdfs.server.federation.router.PeriodicService$1.run(PeriodicService.java:178) > at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) > at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) > at java.lang.Thread.run(Thread.java:748){code} -- This message was sent by Atlassian JIRA (v7.6.14#76016) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org