You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2026/02/13 11:41:00 UTC
[jira] [Commented] (YARN-11907) FairSharePolicy: compareDemand() causes queue starvation for empty queues with pending apps
[ https://issues.apache.org/jira/browse/YARN-11907?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18058397#comment-18058397 ]
ASF GitHub Bot commented on YARN-11907:
---------------------------------------
hadoop-yetus commented on PR #8127:
URL: https://github.com/apache/hadoop/pull/8127#issuecomment-3896731575
:broken_heart: **-1 overall**
| Vote | Subsystem | Runtime | Logfile | Comment |
|:----:|----------:|--------:|:--------:|:-------:|
| +0 :ok: | reexec | 1m 12s | | Docker mode activated. |
|||| _ Prechecks _ |
| +1 :green_heart: | dupname | 0m 0s | | No case conflicting files found. |
| +0 :ok: | codespell | 0m 0s | | codespell was not available. |
| +0 :ok: | detsecrets | 0m 0s | | detect-secrets was not available. |
| +1 :green_heart: | @author | 0m 0s | | The patch does not contain any @author tags. |
| +1 :green_heart: | test4tests | 0m 0s | | The patch appears to include 1 new or modified test files. |
|||| _ trunk Compile Tests _ |
| +1 :green_heart: | mvninstall | 46m 39s | | trunk passed |
| +1 :green_heart: | compile | 1m 23s | | trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04 |
| +1 :green_heart: | compile | 1m 27s | | trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1 |
| +1 :green_heart: | checkstyle | 1m 23s | | trunk passed |
| +1 :green_heart: | mvnsite | 1m 31s | | trunk passed |
| +1 :green_heart: | javadoc | 1m 15s | | trunk passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04 |
| +1 :green_heart: | javadoc | 1m 13s | | trunk passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1 |
| +1 :green_heart: | spotbugs | 2m 40s | | trunk passed |
| +1 :green_heart: | shadedclient | 35m 44s | | branch has no errors when building and testing our client artifacts. |
|||| _ Patch Compile Tests _ |
| +1 :green_heart: | mvninstall | 1m 0s | | the patch passed |
| +1 :green_heart: | compile | 0m 55s | | the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04 |
| +1 :green_heart: | javac | 0m 55s | | the patch passed |
| +1 :green_heart: | compile | 1m 0s | | the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1 |
| +1 :green_heart: | javac | 1m 0s | | the patch passed |
| +1 :green_heart: | blanks | 0m 0s | | The patch has no blanks issues. |
| +1 :green_heart: | checkstyle | 0m 52s | | the patch passed |
| +1 :green_heart: | mvnsite | 1m 2s | | the patch passed |
| +1 :green_heart: | javadoc | 0m 45s | | the patch passed with JDK Ubuntu-21.0.10+7-Ubuntu-124.04 |
| +1 :green_heart: | javadoc | 0m 45s | | the patch passed with JDK Ubuntu-17.0.18+8-Ubuntu-124.04.1 |
| +1 :green_heart: | spotbugs | 2m 19s | | the patch passed |
| +1 :green_heart: | shadedclient | 34m 24s | | patch has no errors when building and testing our client artifacts. |
|||| _ Other Tests _ |
| -1 :x: | unit | 118m 3s | [/patch-unit-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-resourcemanager.txt](https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8127/5/artifact/out/patch-unit-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-resourcemanager.txt) | hadoop-yarn-server-resourcemanager in the patch passed. |
| +1 :green_heart: | asflicense | 0m 38s | | The patch does not generate ASF License warnings. |
| | | 256m 40s | | |
| Reason | Tests |
|-------:|:------|
| Failed junit tests | hadoop.yarn.server.resourcemanager.webapp.TestRMWebServicesReservation |
| | hadoop.yarn.server.resourcemanager.TestRMHA |
| Subsystem | Report/Notes |
|----------:|:-------------|
| Docker | ClientAPI=1.53 ServerAPI=1.53 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8127/5/artifact/out/Dockerfile |
| GITHUB PR | https://github.com/apache/hadoop/pull/8127 |
| Optional Tests | dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets |
| uname | Linux b4233b3d8c14 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux |
| Build tool | maven |
| Personality | dev-support/bin/hadoop.sh |
| git revision | trunk / ca17d20951ebca04058fe0fda573dcb69ddb09e6 |
| Default Java | Ubuntu-17.0.18+8-Ubuntu-124.04.1 |
| Multi-JDK versions | /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.10+7-Ubuntu-124.04 /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.18+8-Ubuntu-124.04.1 |
| Test Results | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8127/5/testReport/ |
| Max. process+thread count | 908 (vs. ulimit of 5500) |
| modules | C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager |
| Console output | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8127/5/console |
| versions | git=2.43.0 maven=3.9.11 spotbugs=4.9.7 |
| Powered by | Apache Yetus 0.14.1 https://yetus.apache.org |
This message was automatically generated.
> FairSharePolicy: compareDemand() causes queue starvation for empty queues with pending apps
> -------------------------------------------------------------------------------------------
>
> Key: YARN-11907
> URL: https://issues.apache.org/jira/browse/YARN-11907
> Project: Hadoop YARN
> Issue Type: Bug
> Components: fairscheduler
> Reporter: Ryu Kobayashi
> Assignee: Ryu Kobayashi
> Priority: Major
> Labels: pull-request-available
>
> h3. Problem
> FairSharePolicy.compareDemand() assigns lowest priority to queues with demand=0, preventing progression to Stage 2 (minShare comparison). This causes severe queue starvation when a queue becomes empty but has applications waiting for
> ApplicationMaster allocation.
> h3. Reproduction Scenario
> A leaf queue with the following characteristics experiences starvation:
> * Queue becomes temporarily empty (all previous jobs complete)
> * New applications are submitted and enter ACCEPTED state
> * Queue has demand=0 (no running containers) but getNumRunnableApps() > 0 (apps waiting for AM)
> * Other queues continue receiving AM allocations
> * The empty queue receives no AM allocations for extended periods (hours)
> Observed behavior:
> * Queue remains starved for 2+ hours
> * Multiple applications wait 100+ minutes for AM allocation
> * Cluster has available resources during this period
> * Other queues receive thousands of container allocations
> h3. Root Cause{*}{*}
> [FairSharePolicy.java|https://github.com/apache/hadoop/blob/rel/release-3.4.2/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/policies/FairSharePolicy.java#L119-L131]
> Lines 119-131:
> {code:java}
> private int compareDemand(Schedulable s1, Schedulable s2) {
> int res = 0;
> long demand1 = s1.getDemand().getMemorySize();
> long demand2 = s2.getDemand().getMemorySize();
> if ((demand1 == 0) && (demand2 > 0)) {
> res = 1; // Queue with demand=0 receives lowest priority
> } else if ((demand2 == 0) && (demand1 > 0)) {
> res = -1;
> }
> return res;
> } {code}
> When a queue has no running containers (demand=0) but has applications in ACCEPTED state waiting for AM allocation, the queue is assigned lowest priority in Stage 1 comparison and never progresses to Stage 2 (minShare comparison), making
> minResources configuration ineffective.
> h3. Why Configuration Cannot Solve This
> Setting minResources in fair-scheduler.xml does not prevent this starvation due to two issues:
> 1. Stage 1 blocks Stage 2: compareDemand() returns non-zero for empty queues, preventing progression to compareMinShareUsage()
> 2. MinShare calculation caps at demand: Even if reaching Stage 2, lines 136-141 cap minShare:
> long minShare1 = Math.min(s1.getMinShare().getMemorySize(),
> s1.getDemand().getMemorySize()); // When demand=0, minShare becomes 0
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org