Merge -r 1428399:1428400 from trunk to branch-2. Fixes: YARN-301. Fair scheduler throws ConcurrentModificationException when iterating over app's priorities. Contributed by Sandy Ryza.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1428401 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7fcf0ec2aa
commit
ece31146cf
@ -147,6 +147,9 @@ Release 2.0.3-alpha - Unreleased
|
|||||||
YARN-300. After YARN-271, fair scheduler can infinite loop and not
|
YARN-300. After YARN-271, fair scheduler can infinite loop and not
|
||||||
schedule any application. (Sandy Ryza via tomwhite)
|
schedule any application. (Sandy Ryza via tomwhite)
|
||||||
|
|
||||||
|
YARN-301. Fair scheduler throws ConcurrentModificationException when
|
||||||
|
iterating over app's priorities. (Sandy Ryza via tomwhite)
|
||||||
|
|
||||||
Release 2.0.2-alpha - 2012-09-07
|
Release 2.0.2-alpha - 2012-09-07
|
||||||
|
|
||||||
YARN-9. Rename YARN_HOME to HADOOP_YARN_HOME. (vinodkv via acmurthy)
|
YARN-9. Rename YARN_HOME to HADOOP_YARN_HOME. (vinodkv via acmurthy)
|
||||||
|
@ -305,34 +305,36 @@ public Resource assignContainer(FSSchedulerNode node, boolean reserved) {
|
|||||||
// For each priority, see if we can schedule a node local, rack local
|
// For each priority, see if we can schedule a node local, rack local
|
||||||
// or off-switch request. Rack of off-switch requests may be delayed
|
// or off-switch request. Rack of off-switch requests may be delayed
|
||||||
// (not scheduled) in order to promote better locality.
|
// (not scheduled) in order to promote better locality.
|
||||||
for (Priority priority : prioritiesToTry) {
|
synchronized (app) {
|
||||||
app.addSchedulingOpportunity(priority);
|
for (Priority priority : prioritiesToTry) {
|
||||||
NodeType allowedLocality = app.getAllowedLocalityLevel(priority,
|
app.addSchedulingOpportunity(priority);
|
||||||
scheduler.getNumClusterNodes(), scheduler.getNodeLocalityThreshold(),
|
NodeType allowedLocality = app.getAllowedLocalityLevel(priority,
|
||||||
scheduler.getRackLocalityThreshold());
|
scheduler.getNumClusterNodes(), scheduler.getNodeLocalityThreshold(),
|
||||||
|
scheduler.getRackLocalityThreshold());
|
||||||
|
|
||||||
ResourceRequest localRequest = app.getResourceRequest(priority,
|
ResourceRequest localRequest = app.getResourceRequest(priority,
|
||||||
node.getHostName());
|
node.getHostName());
|
||||||
if (localRequest != null && localRequest.getNumContainers() != 0) {
|
if (localRequest != null && localRequest.getNumContainers() != 0) {
|
||||||
return assignContainer(node, app, priority,
|
return assignContainer(node, app, priority,
|
||||||
localRequest, NodeType.NODE_LOCAL, reserved);
|
localRequest, NodeType.NODE_LOCAL, reserved);
|
||||||
}
|
}
|
||||||
|
|
||||||
ResourceRequest rackLocalRequest = app.getResourceRequest(priority,
|
ResourceRequest rackLocalRequest = app.getResourceRequest(priority,
|
||||||
node.getRackName());
|
node.getRackName());
|
||||||
if (rackLocalRequest != null && rackLocalRequest.getNumContainers() != 0
|
if (rackLocalRequest != null && rackLocalRequest.getNumContainers() != 0
|
||||||
&& (allowedLocality.equals(NodeType.RACK_LOCAL) ||
|
&& (allowedLocality.equals(NodeType.RACK_LOCAL) ||
|
||||||
allowedLocality.equals(NodeType.OFF_SWITCH))) {
|
allowedLocality.equals(NodeType.OFF_SWITCH))) {
|
||||||
return assignContainer(node, app, priority, rackLocalRequest,
|
return assignContainer(node, app, priority, rackLocalRequest,
|
||||||
NodeType.RACK_LOCAL, reserved);
|
NodeType.RACK_LOCAL, reserved);
|
||||||
}
|
}
|
||||||
|
|
||||||
ResourceRequest offSwitchRequest = app.getResourceRequest(priority,
|
ResourceRequest offSwitchRequest = app.getResourceRequest(priority,
|
||||||
RMNode.ANY);
|
RMNode.ANY);
|
||||||
if (offSwitchRequest != null && offSwitchRequest.getNumContainers() != 0
|
if (offSwitchRequest != null && offSwitchRequest.getNumContainers() != 0
|
||||||
&& allowedLocality.equals(NodeType.OFF_SWITCH)) {
|
&& allowedLocality.equals(NodeType.OFF_SWITCH)) {
|
||||||
return assignContainer(node, app, priority, offSwitchRequest,
|
return assignContainer(node, app, priority, offSwitchRequest,
|
||||||
NodeType.OFF_SWITCH, reserved);
|
NodeType.OFF_SWITCH, reserved);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Resources.none();
|
return Resources.none();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user