From 413a4c3c05d317090c706385c51e4cabcfd92b0e Mon Sep 17 00:00:00 2001 From: Brahma Reddy Battula Date: Tue, 30 Mar 2021 13:52:07 +0530 Subject: [PATCH] YARN-10466.Fix NullPointerException in yarn-services Component.java. Contributed by D M Murali Krishna Reddy --- .../org/apache/hadoop/yarn/service/component/Component.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/Component.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/Component.java index 0b0ba7945d6..0e031f4ba51 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/Component.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/component/Component.java @@ -830,6 +830,11 @@ public class Component implements EventHandler { targetExpressions.toArray(new TargetExpression[0])).build(); break; } + if (constraint == null) { + LOG.info("[COMPONENT {}] Placement constraint: null ", + componentSpec.getName()); + continue; + } // The default AND-ed final composite constraint if (finalConstraint != null) { finalConstraint = PlacementConstraints