YARN-8025. UsersManangers#getComputedResourceLimitForActiveUsers throws NPE due to preComputedActiveUserLimit is empty. Contributed by Tao Yang.
This commit is contained in:
parent
e9159db623
commit
67f239c42f
|
@ -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