YARN-4047. ClientRMService getApplications has high scheduler lock contention. Contributed by Jason Lowe

(cherry picked from commit 7a445fcfab)

Conflicts:
	hadoop-yarn-project/CHANGES.txt
This commit is contained in:
Jian He 2015-08-13 16:02:57 -07:00
parent 617e294a63
commit de1c4121a1
2 changed files with 10 additions and 4 deletions

View File

@ -49,6 +49,9 @@ Release 2.7.2 - UNRELEASED
YARN-3999. RM hangs on draing events. (Jian He via xgong)
YARN-4047. ClientRMService getApplications has high scheduler lock contention
(Jason Lowe via jianhe)
Release 2.7.1 - 2015-07-06
INCOMPATIBLE CHANGES

View File

@ -744,13 +744,9 @@ public class ClientRMService extends AbstractService implements
RMApp application = appsIter.next();
// Check if current application falls under the specified scope
boolean allowAccess = checkAccess(callerUGI, application.getUser(),
ApplicationAccessType.VIEW_APP, application);
if (scope == ApplicationsRequestScope.OWN &&
!callerUGI.getUserName().equals(application.getUser())) {
continue;
} else if (scope == ApplicationsRequestScope.VIEWABLE && !allowAccess) {
continue;
}
if (applicationTypes != null && !applicationTypes.isEmpty()) {
@ -799,6 +795,13 @@ public class ClientRMService extends AbstractService implements
}
}
// checkAccess can grab the scheduler lock so call it last
boolean allowAccess = checkAccess(callerUGI, application.getUser(),
ApplicationAccessType.VIEW_APP, application);
if (scope == ApplicationsRequestScope.VIEWABLE && !allowAccess) {
continue;
}
reports.add(application.createAndGetApplicationReport(
callerUGI.getUserName(), allowAccess));
}