YARN-8025. UsersManangers#getComputedResourceLimitForActiveUsers throws NPE due to preComputedActiveUserLimit is empty. Contributed by Tao Yang.
(Cherry picked from commit 67f239c42f
)
This commit is contained in:
parent
864640c1e3
commit
68dd01efc1
|
@ -490,11 +490,12 @@ public class UsersManager implements AbstractUsersManager {
|
|||
Resource clusterResource, String nodePartition,
|
||||
SchedulingMode schedulingMode) {
|
||||
|
||||
Map<SchedulingMode, Resource> userLimitPerSchedulingMode = preComputedActiveUserLimit
|
||||
.get(nodePartition);
|
||||
Map<SchedulingMode, Resource> userLimitPerSchedulingMode;
|
||||
|
||||
try {
|
||||
writeLock.lock();
|
||||
userLimitPerSchedulingMode =
|
||||
preComputedActiveUserLimit.get(nodePartition);
|
||||
if (isRecomputeNeeded(schedulingMode, nodePartition, true)) {
|
||||
// recompute
|
||||
userLimitPerSchedulingMode = reComputeUserLimits(userName,
|
||||
|
@ -548,11 +549,11 @@ public class UsersManager implements AbstractUsersManager {
|
|||
Resource clusterResource, String nodePartition,
|
||||
SchedulingMode schedulingMode) {
|
||||
|
||||
Map<SchedulingMode, Resource> userLimitPerSchedulingMode = preComputedAllUserLimit
|
||||
.get(nodePartition);
|
||||
Map<SchedulingMode, Resource> userLimitPerSchedulingMode;
|
||||
|
||||
try {
|
||||
writeLock.lock();
|
||||
userLimitPerSchedulingMode = preComputedAllUserLimit.get(nodePartition);
|
||||
if (isRecomputeNeeded(schedulingMode, nodePartition, false)) {
|
||||
// recompute
|
||||
userLimitPerSchedulingMode = reComputeUserLimits(userName,
|
||||
|
|
Loading…
Reference in New Issue