Skip to content

YARN-11967. Addendum: don't enable pmem/vmem checks in DistributedShellBaseTest#8595

Open
singer-bin wants to merge 1 commit into
apache:trunkfrom
singer-bin:YARN-11967-followup
Open

YARN-11967. Addendum: don't enable pmem/vmem checks in DistributedShellBaseTest#8595
singer-bin wants to merge 1 commit into
apache:trunkfrom
singer-bin:YARN-11967-followup

Conversation

@singer-bin

Copy link
Copy Markdown
Contributor

Description of PR

Follow-up / addendum to #8573 (YARN-11967).

After #8573, strictMemoryEnforcement defaults to false — it now requires both yarn.nodemanager.resource.memory.enabled (default false) and yarn.nodemanager.resource.memory.enforced (default true). As a result, ContainersMonitorImpl#checkLimit() no longer takes the strict-only early-return path by default and the polling-based pmem/vmem check actually runs.

DistributedShellBaseTest#setupInternal enables the polling checks:

conf.setBoolean(YarnConfiguration.NM_PMEM_CHECK_ENABLED, true);
conf.setBoolean(YarnConfiguration.NM_VMEM_CHECK_ENABLED, true);

Historically these settings were silent no-ops, because strict enforcement was on by default and checkLimit() short-circuited before reaching the polling logic. After YARN-11967 they take effect, and MiniYARNCluster containers running under the tiny MIN_ALLOCATION_MB limit get killed for exceeding pmem/vmem, which is what @pan3793 observed on trunk after the merge.

Fix

Disable the polling pmem/vmem checks in the base test config. ContainersMonitorImpl itself is still enabled (governed by NM_CONTAINER_MONITOR_ENABLED, default true), so resource-utilization tracking used by the opportunistic-container setup below is preserved. These tests do not exercise memory enforcement (no KILLED_EXCEEDED_PMEM / KILLED_EXCEEDED_VMEM assertions anywhere in the module).

Why the fix is safe

  • isContainerMonitorEnabled() reads only NM_CONTAINER_MONITOR_ENABLED — it does not depend on the pmem/vmem check flags, so ContainersMonitorImpl remains active and reports utilization for opportunistic scheduling.
  • The DistributedShell tests never asserted on memory-kill behaviour; the flags were effectively unused before this change.
  • Same-file behaviour is otherwise unchanged (comment updated to explain the rationale).

How was this patch tested?

Only Linux CI can reproduce the original failure (macOS has no /proc, so ProcfsBasedProcessTree cannot sample memory locally). Relying on GHA to validate on apache/hadoop trunk.

For code changes:

  • Does the title or this PR starts with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')?

cc @pan3793 @Hexiaoqiao

…llBaseTest

After YARN-11967, strictMemoryEnforcement defaults to false (it now requires yarn.nodemanager.resource.memory.enabled in addition to .enforced), so the polling-based memory check actually runs in these MiniYARNCluster tests and kills containers that exceed the tiny MIN_ALLOCATION_MB limit. These checks were previously no-ops (silently skipped by strict enforcement) and the tests do not exercise memory enforcement. Disable NM_PMEM_CHECK_ENABLED/NM_VMEM_CHECK_ENABLED while keeping ContainersMonitorImpl enabled for the resource-utilization tracking used by opportunistic containers.
@singer-bin

Copy link
Copy Markdown
Contributor Author

Hi @pan3793 , thanks for flagging this — I've looked into it and opened an addendum PR: #8595.

Root cause: DistributedShellBaseTest#setupInternal enables NM_PMEM_CHECK_ENABLED / NM_VMEM_CHECK_ENABLED (the comment there is just "Enable ContainersMonitorImpl"). Before YARN-11967, those checks were silent no-ops, because strictMemoryEnforcement defaulted to true and checkLimit() early-returned before the polling logic. After YARN-11967, strictMemoryEnforcement defaults to false (it now also requires yarn.nodemanager.resource.memory.enabled, which is false by default), so the polling check actually runs and kills the MiniYARNCluster containers that legitimately exceed the tiny MIN_ALLOCATION_MB limit.

Fix (in #8595): disable the polling pmem/vmem checks in the base test config. ContainersMonitorImpl itself is still enabled (NM_CONTAINER_MONITOR_ENABLED defaults to true and does not depend on the check flags), so utilization tracking used by the opportunistic-container setup right below is preserved. The DistributedShell tests never asserted on memory-kill behaviour, so no coverage is lost.

Would appreciate your review on #8595. Thanks again!

@hadoop-yetus

Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 51s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 47m 2s trunk passed
+1 💚 compile 0m 50s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 compile 0m 48s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 checkstyle 0m 49s trunk passed
+1 💚 mvnsite 0m 52s trunk passed
+1 💚 javadoc 0m 51s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 0m 47s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 1m 9s trunk passed
+1 💚 shadedclient 36m 59s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 27s the patch passed
+1 💚 compile 0m 19s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javac 0m 19s the patch passed
+1 💚 compile 0m 19s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 javac 0m 19s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 18s the patch passed
+1 💚 mvnsite 0m 22s the patch passed
+1 💚 javadoc 0m 19s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 0m 19s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 0m 51s the patch passed
+1 💚 shadedclient 35m 22s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 22m 35s hadoop-yarn-applications-distributedshell in the patch passed.
+1 💚 asflicense 0m 42s The patch does not generate ASF License warnings.
155m 47s
Subsystem Report/Notes
Docker ClientAPI=1.55 ServerAPI=1.55 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8595/1/artifact/out/Dockerfile
GITHUB PR #8595
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 807f3b03d59e 5.15.0-181-generic #191-Ubuntu SMP Fri May 22 19:09:02 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / f0e209e
Default Java Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.11+10-1-24.04.2-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8595/1/testReport/
Max. process+thread count 612 (vs. ulimit of 10000)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8595/1/console
versions git=2.43.0 maven=3.9.15 spotbugs=4.9.7
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

@pan3793

pan3793 commented Jul 10, 2026

Copy link
Copy Markdown
Member

@Hexiaoqiao are you fine with this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants