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
d9fae993b4
commit
a0b7abf278
|
@ -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