Skip to content

YARN-11608. Fix QueueCapacityVectorInfo NPE when accessible labels config is used. #6250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.QueueResourceQuotas;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.QueueCapacities;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.QueueCapacityVector;

/**
* DAO which wraps PartitionQueueCapacitiesInfo applicable for a queue
Expand Down Expand Up @@ -57,8 +58,10 @@ public QueueCapacitiesInfo(CSQueue queue, boolean considerAMUsage) {
float weight;
float normalizedWeight;
for (String partitionName : capacities.getExistingNodeLabels()) {
queueCapacityVectorInfo = new QueueCapacityVectorInfo(
queue.getConfiguredCapacityVector(partitionName));
QueueCapacityVector queueCapacityVector = queue.getConfiguredCapacityVector(partitionName);
queueCapacityVectorInfo = queueCapacityVector == null ?
new QueueCapacityVectorInfo(new QueueCapacityVector()) :
new QueueCapacityVectorInfo(queue.getConfiguredCapacityVector(partitionName));
usedCapacity = capacities.getUsedCapacity(partitionName) * 100;
capacity = capacities.getCapacity(partitionName) * 100;
maxCapacity = capacities.getMaximumCapacity(partitionName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ private Configuration createConfig() {
conf.set("yarn.scheduler.capacity.legacy-queue-mode.enabled", String.valueOf(legacyQueueMode));
conf.set("yarn.scheduler.capacity.root.queues", "a, b, c");
conf.set("yarn.scheduler.capacity.root.a.capacity", "12.5");
conf.set("yarn.scheduler.capacity.root.a.accessible-node-labels", "root-a-default-label");
conf.set("yarn.scheduler.capacity.root.a.maximum-capacity", "50");
conf.set("yarn.scheduler.capacity.root.a.max-parallel-app", "42");
conf.set("yarn.scheduler.capacity.root.b.capacity", "50");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</resourceInformations>
</resourcesUsed>
<hideReservationQueues>false</hideReservationQueues>
<nodeLabels>*</nodeLabels>
<nodeLabels>root-a-default-label</nodeLabels>
<allocatedContainers>0</allocatedContainers>
<reservedContainers>0</reservedContainers>
<pendingContainers>0</pendingContainers>
Expand Down Expand Up @@ -185,6 +185,117 @@
</resourceInformations>
</effectiveMaxResource>
</queueCapacitiesByPartition>
<queueCapacitiesByPartition>
<partitionName>root-a-default-label</partitionName>
<queueCapacityVectorInfo>
<configuredCapacityVector>[]</configuredCapacityVector>
</queueCapacityVectorInfo>
<capacity>0.0</capacity>
<usedCapacity>0.0</usedCapacity>
<maxCapacity>100.0</maxCapacity>
<absoluteCapacity>0.0</absoluteCapacity>
<absoluteUsedCapacity>0.0</absoluteUsedCapacity>
<absoluteMaxCapacity>0.0</absoluteMaxCapacity>
<maxAMLimitPercentage>0.0</maxAMLimitPercentage>
<weight>-1.0</weight>
<normalizedWeight>0.0</normalizedWeight>
<configuredMinResource>
<memory>0</memory>
<vCores>0</vCores>
<resourceInformations>
<resourceInformation>
<attributes/>
<maximumAllocation>8192</maximumAllocation>
<minimumAllocation>1024</minimumAllocation>
<name>memory-mb</name>
<resourceType>COUNTABLE</resourceType>
<units>Mi</units>
<value>0</value>
</resourceInformation>
<resourceInformation>
<attributes/>
<maximumAllocation>4</maximumAllocation>
<minimumAllocation>1</minimumAllocation>
<name>vcores</name>
<resourceType>COUNTABLE</resourceType>
<units/>
<value>0</value>
</resourceInformation>
</resourceInformations>
</configuredMinResource>
<configuredMaxResource>
<memory>0</memory>
<vCores>0</vCores>
<resourceInformations>
<resourceInformation>
<attributes/>
<maximumAllocation>8192</maximumAllocation>
<minimumAllocation>1024</minimumAllocation>
<name>memory-mb</name>
<resourceType>COUNTABLE</resourceType>
<units>Mi</units>
<value>0</value>
</resourceInformation>
<resourceInformation>
<attributes/>
<maximumAllocation>4</maximumAllocation>
<minimumAllocation>1</minimumAllocation>
<name>vcores</name>
<resourceType>COUNTABLE</resourceType>
<units/>
<value>0</value>
</resourceInformation>
</resourceInformations>
</configuredMaxResource>
<effectiveMinResource>
<memory>0</memory>
<vCores>0</vCores>
<resourceInformations>
<resourceInformation>
<attributes/>
<maximumAllocation>8192</maximumAllocation>
<minimumAllocation>1024</minimumAllocation>
<name>memory-mb</name>
<resourceType>COUNTABLE</resourceType>
<units>Mi</units>
<value>0</value>
</resourceInformation>
<resourceInformation>
<attributes/>
<maximumAllocation>4</maximumAllocation>
<minimumAllocation>1</minimumAllocation>
<name>vcores</name>
<resourceType>COUNTABLE</resourceType>
<units/>
<value>0</value>
</resourceInformation>
</resourceInformations>
</effectiveMinResource>
<effectiveMaxResource>
<memory>0</memory>
<vCores>0</vCores>
<resourceInformations>
<resourceInformation>
<attributes/>
<maximumAllocation>8192</maximumAllocation>
<minimumAllocation>1024</minimumAllocation>
<name>memory-mb</name>
<resourceType>COUNTABLE</resourceType>
<units>Mi</units>
<value>0</value>
</resourceInformation>
<resourceInformation>
<attributes/>
<maximumAllocation>4</maximumAllocation>
<minimumAllocation>1</minimumAllocation>
<name>vcores</name>
<resourceType>COUNTABLE</resourceType>
<units/>
<value>0</value>
</resourceInformation>
</resourceInformations>
</effectiveMaxResource>
</queueCapacitiesByPartition>
</capacities>
<resources>
<resourceUsagesByPartition>
Expand Down Expand Up @@ -334,6 +445,153 @@
</resourceInformations>
</userAmLimit>
</resourceUsagesByPartition>
<resourceUsagesByPartition>
<partitionName>root-a-default-label</partitionName>
<used>
<memory>0</memory>
<vCores>0</vCores>
<resourceInformations>
<resourceInformation>
<attributes/>
<maximumAllocation>9223372036854775807</maximumAllocation>
<minimumAllocation>0</minimumAllocation>
<name>memory-mb</name>
<resourceType>COUNTABLE</resourceType>
<units>Mi</units>
<value>0</value>
</resourceInformation>
<resourceInformation>
<attributes/>
<maximumAllocation>9223372036854775807</maximumAllocation>
<minimumAllocation>0</minimumAllocation>
<name>vcores</name>
<resourceType>COUNTABLE</resourceType>
<units/>
<value>0</value>
</resourceInformation>
</resourceInformations>
</used>
<reserved>
<memory>0</memory>
<vCores>0</vCores>
<resourceInformations>
<resourceInformation>
<attributes/>
<maximumAllocation>9223372036854775807</maximumAllocation>
<minimumAllocation>0</minimumAllocation>
<name>memory-mb</name>
<resourceType>COUNTABLE</resourceType>
<units>Mi</units>
<value>0</value>
</resourceInformation>
<resourceInformation>
<attributes/>
<maximumAllocation>9223372036854775807</maximumAllocation>
<minimumAllocation>0</minimumAllocation>
<name>vcores</name>
<resourceType>COUNTABLE</resourceType>
<units/>
<value>0</value>
</resourceInformation>
</resourceInformations>
</reserved>
<pending>
<memory>0</memory>
<vCores>0</vCores>
<resourceInformations>
<resourceInformation>
<attributes/>
<maximumAllocation>9223372036854775807</maximumAllocation>
<minimumAllocation>0</minimumAllocation>
<name>memory-mb</name>
<resourceType>COUNTABLE</resourceType>
<units>Mi</units>
<value>0</value>
</resourceInformation>
<resourceInformation>
<attributes/>
<maximumAllocation>9223372036854775807</maximumAllocation>
<minimumAllocation>0</minimumAllocation>
<name>vcores</name>
<resourceType>COUNTABLE</resourceType>
<units/>
<value>0</value>
</resourceInformation>
</resourceInformations>
</pending>
<amUsed>
<memory>0</memory>
<vCores>0</vCores>
<resourceInformations>
<resourceInformation>
<attributes/>
<maximumAllocation>9223372036854775807</maximumAllocation>
<minimumAllocation>0</minimumAllocation>
<name>memory-mb</name>
<resourceType>COUNTABLE</resourceType>
<units>Mi</units>
<value>0</value>
</resourceInformation>
<resourceInformation>
<attributes/>
<maximumAllocation>9223372036854775807</maximumAllocation>
<minimumAllocation>0</minimumAllocation>
<name>vcores</name>
<resourceType>COUNTABLE</resourceType>
<units/>
<value>0</value>
</resourceInformation>
</resourceInformations>
</amUsed>
<amLimit>
<memory>0</memory>
<vCores>0</vCores>
<resourceInformations>
<resourceInformation>
<attributes/>
<maximumAllocation>9223372036854775807</maximumAllocation>
<minimumAllocation>0</minimumAllocation>
<name>memory-mb</name>
<resourceType>COUNTABLE</resourceType>
<units>Mi</units>
<value>0</value>
</resourceInformation>
<resourceInformation>
<attributes/>
<maximumAllocation>9223372036854775807</maximumAllocation>
<minimumAllocation>0</minimumAllocation>
<name>vcores</name>
<resourceType>COUNTABLE</resourceType>
<units/>
<value>0</value>
</resourceInformation>
</resourceInformations>
</amLimit>
<userAmLimit>
<memory>0</memory>
<vCores>0</vCores>
<resourceInformations>
<resourceInformation>
<attributes/>
<maximumAllocation>9223372036854775807</maximumAllocation>
<minimumAllocation>0</minimumAllocation>
<name>memory-mb</name>
<resourceType>COUNTABLE</resourceType>
<units>Mi</units>
<value>0</value>
</resourceInformation>
<resourceInformation>
<attributes/>
<maximumAllocation>9223372036854775807</maximumAllocation>
<minimumAllocation>0</minimumAllocation>
<name>vcores</name>
<resourceType>COUNTABLE</resourceType>
<units/>
<value>0</value>
</resourceInformation>
</resourceInformations>
</userAmLimit>
</resourceUsagesByPartition>
</resources>
<minEffectiveCapacity>
<memory>4096</memory>
Expand Down
Loading