YARN-3487. CapacityScheduler scheduler lock obtained unnecessarily when calling getQueue (Jason Lowe via wangda)

(cherry picked from commit f47a5763ac)
This commit is contained in:
Wangda Tan 2015-04-17 17:22:27 -07:00
parent 7569289e99
commit d6105d944c
2 changed files with 4 additions and 6 deletions

View File

@ -11,6 +11,8 @@ Release 2.7.1 - UNRELEASED
OPTIMIZATIONS OPTIMIZATIONS
BUG FIXES BUG FIXES
YARN-3487. CapacityScheduler scheduler lock obtained unnecessarily when
calling getQueue (Jason Lowe via wangda)
YARN-3462. Patches applied for YARN-2424 are inconsistent between YARN-3462. Patches applied for YARN-2424 are inconsistent between
trunk and branch-2. (Naganarasimha G R via harsh) trunk and branch-2. (Naganarasimha G R via harsh)

View File

@ -627,7 +627,7 @@ public class CapacityScheduler extends
return queue; return queue;
} }
public synchronized CSQueue getQueue(String queueName) { public CSQueue getQueue(String queueName) {
if (queueName == null) { if (queueName == null) {
return null; return null;
} }
@ -925,11 +925,7 @@ public class CapacityScheduler extends
boolean includeChildQueues, boolean recursive) boolean includeChildQueues, boolean recursive)
throws IOException { throws IOException {
CSQueue queue = null; CSQueue queue = null;
queue = this.queues.get(queueName);
synchronized (this) {
queue = this.queues.get(queueName);
}
if (queue == null) { if (queue == null) {
throw new IOException("Unknown queue: " + queueName); throw new IOException("Unknown queue: " + queueName);
} }