From 5358313f97d25e6e950873630c811b1cbde73f12 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 (cherry picked from commit 413a4c3c05d317090c706385c51e4cabcfd92b0e) --- .../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 1f3ca22f08..04729772ff 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 @@ -833,6 +833,11 @@ public void requestContainers(long count) { 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