TaoYang526 commented on code in PR #7065: URL: https://github.com/apache/hadoop/pull/7065#discussion_r1779890901
########## hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/AbstractYarnScheduler.java: ########## @@ -757,10 +757,9 @@ private void completeOustandingUpdatesWhichAreReserved( RMContainer rmContainer, ContainerStatus containerStatus, RMContainerEventType event) { N schedulerNode = getSchedulerNode(rmContainer.getNodeId()); - if (schedulerNode != null && - schedulerNode.getReservedContainer() != null) { + if (schedulerNode != null) { RMContainer resContainer = schedulerNode.getReservedContainer(); - if (resContainer.getReservedSchedulerKey() != null) { + if (resContainer != null && resContainer.getReservedSchedulerKey() != null) { Review Comment: Thanks @zeekling for the review. I'm not sure why your environment still reported NPE after changing like that, `resContainer.getReservedSchedulerKey()` won't throw NPE any more with the previous not-null check: `if resContainer is null`. Could you please attach some details of the NPE and your changes? For this change, I think NPE should be fixed instead of be caught in general. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org