bgoerlitz commented on code in PR #6148:
URL: https://github.com/apache/hadoop/pull/6148#discussion_r1366074215


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacitySchedulerQueueManager.java:
##########
@@ -509,6 +509,12 @@ public AbstractLeafQueue createQueue(QueuePath queue)
     String leafQueueName = queue.getLeafName();
     String parentQueueName = queue.getParent();
 
+    if (StringUtils.isEmpty(leafQueueName)) {
+      throw new SchedulerDynamicEditException(
+              "Trying to create new queue=" + queue.getFullPath()
+                      + ", which has empty leaf shortname.");
+    }
+

Review Comment:
   Agreed with this. This path currently does fail due to the fact that 
`QueuePath.hasEmptyParts()` does not actually return true for an empty leaf 
name, but the added unit test for `QueueManager.createQueue(QueuePath)` is not 
necessary, so I will remove that in the next commit.



-- 
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]

Reply via email to