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 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]