diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/placement/CSMappingPlacementRule.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/placement/CSMappingPlacementRule.java index aff75bae34..b1a733dfd1 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/placement/CSMappingPlacementRule.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/placement/CSMappingPlacementRule.java @@ -181,6 +181,11 @@ private void setupGroupsForVariableContext(VariableContext vctx, String user) return; } Set groupsSet = groups.getGroupsSet(user); + if (groupsSet.isEmpty()) { + LOG.warn("There are no groups for user {}", user); + vctx.putExtraDataset("groups", groupsSet); + return; + } String secondaryGroup = null; Iterator it = groupsSet.iterator(); String primaryGroup = it.next();