K0K0V0K commented on code in PR #7041:
URL: https://github.com/apache/hadoop/pull/7041#discussion_r1764751050
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java:
##########
@@ -3366,14 +3367,47 @@ public boolean moveReservedContainer(RMContainer
toBeMovedContainer,
@Override
public long checkAndGetApplicationLifetime(String queueName,
Review Comment:
I think instead of add this create new queue logic to the method we could
make the getOrCreateQueueFromPlacementContext public and call it before we call
the checkAndGetApplicationLifetime method. If i see well this
checkAndGetApplicationLifetime used just once in the code
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java:
##########
@@ -3366,14 +3367,47 @@ public boolean moveReservedContainer(RMContainer
toBeMovedContainer,
@Override
public long checkAndGetApplicationLifetime(String queueName,
- long lifetimeRequestedByApp) {
- readLock.lock();
+ long lifetimeRequestedByApp,
RMAppImpl app) {
+ CSQueue queue;
+
+ writeLock.lock();
try {
- CSQueue queue = getQueue(queueName);
+ queue = getQueue(queueName);
+
+ // This handles the case where the first submitted app in aqc queue does
not exist,
+ // addressing the issue related to YARN-11708.
+ if (queue == null) {
+ queue = getOrCreateQueueFromPlacementContext(app.getApplicationId(),
app.getUser(),
+ app.getQueue(), app.getApplicationPlacementContext(), false);
+ }
+
+ if (queue == null) {
+ String message;
+ if (isAmbiguous(queueName)) {
+ message = "Application " + app.getApplicationId()
Review Comment:
I think here we have some code duplication. We can add the
`"Application " + app.getApplicationId() + " submitted by user " +
app.getUser()`
part to the line 3385
--
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]