tomicooler commented on a change in pull request #3938:
URL: https://github.com/apache/hadoop/pull/3938#discussion_r796596655
##########
File path:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMAppManager.java
##########
@@ -469,26 +481,61 @@ private RMAppImpl createAndPopulateNewRMApp(
submissionContext.getQueue() : placementContext.getFullQueuePath();
String appName = submissionContext.getApplicationName();
- CSQueue csqueue = ((CapacityScheduler) scheduler).getQueue(queueName);
+
+ CapacityScheduler cs = (CapacityScheduler) scheduler;
+ CapacitySchedulerConfiguration csConf = cs.getConfiguration();
+
+ CSQueue csqueue = cs.getQueue(queueName);
+ PrivilegedEntity privilegedEntity = getPrivilegedEntity(queueName);
if (csqueue == null && placementContext != null) {
- //could be an auto created queue through queue mapping. Validate
- // parent queue exists and has valid acls
- String parentQueueName = placementContext.getParentQueue();
- csqueue = ((CapacityScheduler) scheduler).getQueue(parentQueueName);
+ List<Permission> permissions = new ArrayList<>();
+
+ final QueuePath parentCandidate = new
QueuePath(placementContext.getParentQueue());
+ AutoCreatedQueueTemplate aqc = new AutoCreatedQueueTemplate(csConf,
parentCandidate);
+
+ CSQueue parentQueue = cs.getQueue(parentCandidate.getFullPath());
+ if (parentQueue == null) {
+ final QueuePath parent = new
QueuePath(parentCandidate.getParent());
+ parentQueue = cs.getQueue(parent.getFullPath());
+ if (parentQueue == null) {
+ throw RPCUtil.getRemoteException(new AccessControlException(
+ "Access denied for invalid queue " +
submissionContext.getQueue() +
+ " parent is not found " + parent.getFullPath() +
+ " user " + user + " applicationId " + applicationId));
+ }
+
Review comment:
Moved the logic to CapacitySchedulerQueueManager, now it's working for
multi level dynamic parents too, and it no longer depends on the placement
context.
--
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]