YARN-4416. Deadlock due to synchronised get Methods in AbstractCSQueue. (Naganarasimha G R via wangda)

This commit is contained in:
Wangda Tan 2015-12-16 13:22:37 -08:00
parent 7faa406f27
commit 9b856d9787
3 changed files with 6 additions and 20 deletions

View File

@ -1148,6 +1148,9 @@ Release 2.8.0 - UNRELEASED
YARN-4225. Add preemption status to yarn queue -status for capacity scheduler. YARN-4225. Add preemption status to yarn queue -status for capacity scheduler.
(Eric Payne via wangda) (Eric Payne via wangda)
YARN-4416. Deadlock due to synchronised get Methods in AbstractCSQueue.
(Naganarasimha G R via wangda)
Release 2.7.3 - UNRELEASED Release 2.7.3 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -46,7 +46,6 @@
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceLimits; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceLimits;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceUsage; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceUsage;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerApplicationAttempt; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerApplicationAttempt;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedContainerChangeRequest;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerUtils; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerUtils;
import org.apache.hadoop.yarn.util.resource.ResourceCalculator; import org.apache.hadoop.yarn.util.resource.ResourceCalculator;
import org.apache.hadoop.yarn.util.resource.Resources; import org.apache.hadoop.yarn.util.resource.Resources;
@ -135,7 +134,7 @@ public float getAbsoluteMaximumCapacity() {
} }
@Override @Override
public synchronized float getAbsoluteUsedCapacity() { public float getAbsoluteUsedCapacity() {
return queueCapacities.getAbsoluteUsedCapacity(); return queueCapacities.getAbsoluteUsedCapacity();
} }
@ -154,7 +153,7 @@ public Resource getUsedResources() {
return queueUsage.getUsed(); return queueUsage.getUsed();
} }
public synchronized int getNumContainers() { public int getNumContainers() {
return numContainers; return numContainers;
} }
@ -203,7 +202,7 @@ public void setUsedCapacity(float usedCapacity) {
} }
@Override @Override
public synchronized void setAbsoluteUsedCapacity(float absUsedCapacity) { public void setAbsoluteUsedCapacity(float absUsedCapacity) {
queueCapacities.setAbsoluteUsedCapacity(absUsedCapacity); queueCapacities.setAbsoluteUsedCapacity(absUsedCapacity);
} }

View File

@ -109,9 +109,6 @@ public class LeafQueue extends AbstractCSQueue {
// cache last cluster resource to compute actual capacity // cache last cluster resource to compute actual capacity
private Resource lastClusterResource = Resources.none(); private Resource lastClusterResource = Resources.none();
// absolute capacity as a resource (based on cluster resource)
private Resource absoluteCapacityResource = Resources.none();
private final QueueResourceLimitsInfo queueResourceLimitsInfo = private final QueueResourceLimitsInfo queueResourceLimitsInfo =
new QueueResourceLimitsInfo(); new QueueResourceLimitsInfo();
@ -144,7 +141,6 @@ protected synchronized void setupQueueConfigs(Resource clusterResource)
super.setupQueueConfigs(clusterResource); super.setupQueueConfigs(clusterResource);
this.lastClusterResource = clusterResource; this.lastClusterResource = clusterResource;
updateAbsoluteCapacityResource(clusterResource);
this.cachedResourceLimitsForHeadroom = new ResourceLimits(clusterResource); this.cachedResourceLimitsForHeadroom = new ResourceLimits(clusterResource);
@ -346,10 +342,6 @@ public synchronized int getNumPendingApplications(String user) {
public synchronized int getNumActiveApplications(String user) { public synchronized int getNumActiveApplications(String user) {
return getUser(user).getActiveApplications(); return getUser(user).getActiveApplications();
} }
public synchronized int getNumContainers() {
return numContainers;
}
@Override @Override
public synchronized QueueState getState() { public synchronized QueueState getState() {
@ -1328,13 +1320,6 @@ synchronized void releaseResource(Resource clusterResource,
} }
} }
private void updateAbsoluteCapacityResource(Resource clusterResource) {
absoluteCapacityResource =
Resources.multiplyAndNormalizeUp(resourceCalculator, labelManager
.getResourceByLabel(RMNodeLabelsManager.NO_LABEL, clusterResource),
queueCapacities.getAbsoluteCapacity(), minimumAllocation);
}
private void updateCurrentResourceLimits( private void updateCurrentResourceLimits(
ResourceLimits currentResourceLimits, Resource clusterResource) { ResourceLimits currentResourceLimits, Resource clusterResource) {
// TODO: need consider non-empty node labels when resource limits supports // TODO: need consider non-empty node labels when resource limits supports
@ -1360,7 +1345,6 @@ public synchronized void updateClusterResource(Resource clusterResource,
ResourceLimits currentResourceLimits) { ResourceLimits currentResourceLimits) {
updateCurrentResourceLimits(currentResourceLimits, clusterResource); updateCurrentResourceLimits(currentResourceLimits, clusterResource);
lastClusterResource = clusterResource; lastClusterResource = clusterResource;
updateAbsoluteCapacityResource(clusterResource);
// Update headroom info based on new cluster resource value // Update headroom info based on new cluster resource value
// absoluteMaxCapacity now, will be replaced with absoluteMaxAvailCapacity // absoluteMaxCapacity now, will be replaced with absoluteMaxAvailCapacity