From c1386a90d7ff65b57be00a7245de82c31abb4665 Mon Sep 17 00:00:00 2001 From: Sunil G Date: Sat, 4 Mar 2017 13:46:35 +0530 Subject: [PATCH] =?UTF-8?q?YARN-6248.=20user=20is=20not=20removed=20from?= =?UTF-8?q?=20UsersManager=E2=80=99s=20when=20app=20is=20killed=20with=20p?= =?UTF-8?q?ending=20container=20requests.=20Contributed=20by=20Eric=20Payn?= =?UTF-8?q?e.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resourcemanager/scheduler/capacity/UsersManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/UsersManager.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/UsersManager.java index 05503c6263d..c2134eb3309 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/UsersManager.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/UsersManager.java @@ -872,7 +872,9 @@ public class UsersManager implements AbstractUsersManager { this.writeLock.lock(); // For UT case: We might need to add the user to users list. - User user = getUserAndAddIfAbsent(userName); + User user = getUser(userName); + if (user == null) return; + ResourceUsage resourceUsage = user.getResourceUsage(); // If User is moved to non-active list, moved resource usage from // non-active to active list.