YARN-11699. Diagnostics lacks userlimit info when user capacity has reached its maximum limit (#6849) Contributed by Jiandan Yang.

Signed-off-by: Shilun Fan <slfan1989@apache.org>
This commit is contained in:
Yang Jiandan 2024-06-01 06:18:28 +08:00 committed by GitHub
parent 9f6c997662
commit 167d4c8447
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1270,8 +1270,14 @@ public CSAssignment assignContainers(Resource clusterResource,
} }
} }
if (!userAssignable) { if (!userAssignable) {
String userName = application.getUser();
User user = getUser(userName);
Resource usedResourceByUser =
user == null ? null : user.getUsed(candidates.getPartition());
application.updateAMContainerDiagnostics(AMState.ACTIVATED, application.updateAMContainerDiagnostics(AMState.ACTIVATED,
"User capacity has reached its maximum limit."); "User capacity has reached its maximum limit," +
" user limit is " + userLimit + ", resource used by " +
userName + " is " + usedResourceByUser + ".");
ActivitiesLogger.APP.recordRejectedAppActivityFromLeafQueue( ActivitiesLogger.APP.recordRejectedAppActivityFromLeafQueue(
activitiesManager, node, application, application.getPriority(), activitiesManager, node, application, application.getPriority(),
ActivityDiagnosticConstant.QUEUE_HIT_USER_MAX_CAPACITY_LIMIT); ActivityDiagnosticConstant.QUEUE_HIT_USER_MAX_CAPACITY_LIMIT);