From 7fcf0ec2aa94a9e81aea3914833ced90151affe7 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 3 Jan 2013 15:10:14 +0000 Subject: [PATCH] Merge -r 1428386:1428387 from trunk to branch-2. Fixes: YARN-300. After YARN-271, fair scheduler can infinite loop and not schedule any application. Contributed by Sandy Ryza. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1428393 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-yarn-project/CHANGES.txt | 3 +++ .../server/resourcemanager/scheduler/fair/FairScheduler.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index bd373186a21..605cb5e1072 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -144,6 +144,9 @@ Release 2.0.3-alpha - Unreleased YARN-288. Fair scheduler queue doesn't accept any jobs when ACLs are configured. (Sandy Ryza via tomwhite) + YARN-300. After YARN-271, fair scheduler can infinite loop and not + schedule any application. (Sandy Ryza via tomwhite) + Release 2.0.2-alpha - 2012-09-07 YARN-9. Rename YARN_HOME to HADOOP_YARN_HOME. (vinodkv via acmurthy) 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/fair/FairScheduler.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairScheduler.java index 305a23527c6..c31a2dbb740 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairScheduler.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FairScheduler.java @@ -760,7 +760,7 @@ public class FairScheduler implements ResourceScheduler { // Otherwise, schedule at queue which is furthest below fair share else { int assignedContainers = 0; - while (true) { + while (node.getReservedContainer() == null) { // At most one task is scheduled each iteration of this loop List scheds = new ArrayList( queueMgr.getLeafQueues());