Skip to content

YARN-11984. Federation mock sub-cluster and router do not stop cleanly on SIGTERM - #8681

Merged
slfan1989 merged 1 commit into
apache:trunkfrom
joseluisll:YARN-11984
Oct 11, 2026
Merged

slfan1989 merged 1 commit into
apache:trunkfrom
joseluisll:YARN-11984

Conversation

@joseluisll

@joseluisll joseluisll commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Depends on (has to be merged first):

Description of PR

JIRA: YARN-11984. Federation mock sub-cluster and router do not stop cleanly on SIGTERM.

TestMockSubCluster and TestMockRouter are not tests: they have no @Test
methods. They are process entry points. TestFederationSubCluster starts each
one as its own JVM through JavaProcess and stops it with Process#destroy.
On Linux and macOS that sends SIGTERM, which runs shutdown hooks. Neither class
registered a hook, so each JVM exited with its services still running: no
serviceStop ran for the sub-clusters' ResourceManager and NodeManagers or for
the Router, and the ZooKeeper sessions were left to expire on their own.

This PR:

  • Registers a CompositeServiceShutdownHook in both entry points, before
    init/start, so a failure part-way through startup still tears down
    whatever came up. Router#main already does this. TestMockRouter starts
    the Router directly, so it skipped the hook.
  • In TestMockRouter, closes the ZooKeeper-backed FederationStateStore, which
    FederationStateStoreFacade never closes. It closes the store the facade
    already holds instead of creating a second one, which would have left the
    first store open. This hook runs at a lower priority than the Router's, so
    the Router stops before its store is closed.
  • Gives the sub-cluster hook a 90s budget. Its three NodeManagers stop one
    after another, about 16s each, which doesn't fit in the 30s default. Sets
    NM_SLEEP_DELAY_BEFORE_SIGKILL_MS to 0 so these long-lived mock clusters
    kill their containers immediately.
  • Makes TestFederationSubCluster#stop signal all three child JVMs before
    waiting for any of them, so their hooks run at the same time.
    JavaProcess gains destroy(), which signals without waiting.

Test code only; no production code changes.

How was this patch tested?

  • On Linux, TestYarnFederationWithCapacityScheduler: 38/38 pass.
  • In the child processes' logs, all three JVMs (two sub-clusters and the
    Router) run their shutdown hooks to completion and close their ZooKeeper
    sessions. No hook hits its timeout.
  • Cost: the suite takes about 96s with the hooks, against about 49s on trunk,
    because the sub-clusters now stop their services instead of being killed.

For code changes:

  • Does the title of this PR start with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')?
  • Object storage: Have the integration tests been executed and the endpoint
    declared according to the connector-specific documentation? Note: Automated CI
    testing doesn't cover all cases so manual testing with cloud storage is still
    required.
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE, LICENSE-binary, NOTICE-binary files?

AI Tooling

If an AI tool was used:

Contains content generated by Claude Code.

@joseluisll
joseluisll marked this pull request as ready for review August 13, 2026 14:53
@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 20s 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 2 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 26m 44s trunk passed
+1 💚 compile 0m 36s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 compile 0m 38s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 checkstyle 0m 35s trunk passed
+1 💚 mvnsite 0m 38s trunk passed
+1 💚 javadoc 0m 35s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 0m 36s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 0m 53s trunk passed
+1 💚 shadedclient 15m 44s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 18s the patch passed
+1 💚 compile 0m 16s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javac 0m 16s the patch passed
+1 💚 compile 0m 16s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 javac 0m 16s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 14s the patch passed
+1 💚 mvnsite 0m 19s the patch passed
+1 💚 javadoc 0m 16s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 0m 17s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 0m 37s the patch passed
+1 💚 shadedclient 14m 56s patch has no errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 11m 7s /patch-unit-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-router.txt hadoop-yarn-server-router in the patch passed.
+1 💚 asflicense 0m 24s The patch does not generate ASF License warnings.
78m 5s
Reason Tests
Failed junit tests hadoop.yarn.server.router.webapp.TestFederationWebApp
hadoop.yarn.server.router.webapp.TestRouterWebServicesREST
Subsystem Report/Notes
Docker ClientAPI=1.55 ServerAPI=1.55 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/1/artifact/out/Dockerfile
GITHUB PR #8681
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 716ad34cd9c1 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 / aaccd92
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-8681/1/testReport/
Max. process+thread count 1315 (vs. ulimit of 10000)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/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.

@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 24s 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 2 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 28m 20s trunk passed
+1 💚 compile 0m 36s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 compile 0m 36s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 checkstyle 0m 36s trunk passed
+1 💚 mvnsite 0m 39s trunk passed
+1 💚 javadoc 0m 33s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 0m 35s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 0m 52s trunk passed
+1 💚 shadedclient 16m 2s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 19s 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 17s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 javac 0m 17s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 13s the patch passed
+1 💚 mvnsite 0m 19s the patch passed
+1 💚 javadoc 0m 17s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 0m 16s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 0m 40s the patch passed
+1 💚 shadedclient 15m 9s patch has no errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 10m 3s /patch-unit-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-router.txt hadoop-yarn-server-router in the patch passed.
+1 💚 asflicense 0m 25s The patch does not generate ASF License warnings.
79m 22s
Reason Tests
Failed junit tests hadoop.yarn.server.router.webapp.TestRouterWebServicesREST
Subsystem Report/Notes
Docker ClientAPI=1.55 ServerAPI=1.55 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/2/artifact/out/Dockerfile
GITHUB PR #8681
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 1dcc7b9b5aac 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 / 5432b7e
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-8681/2/testReport/
Max. process+thread count 1310 (vs. ulimit of 10000)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/2/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.

@slfan1989 slfan1989 self-assigned this Aug 15, 2026

@slfan1989 slfan1989 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing the shutdown lifecycle of the federation test processes. The service shutdown hooks, their ordering, and the extended timeout for the MiniYARNCluster look reasonable.

I found one remaining lifecycle issue in TestMockRouter: Router startup already initializes a FederationStateStore, but the code subsequently creates a second store and replaces the facade reference without closing the first one. The newly added hook therefore does not close every ZooKeeper-backed store created by the Router process. Please address the inline comment.

@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 22s 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 2 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 25m 1s trunk passed
+1 💚 compile 0m 36s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 compile 0m 34s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 checkstyle 0m 34s trunk passed
+1 💚 mvnsite 0m 36s trunk passed
+1 💚 javadoc 0m 39s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 0m 36s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 0m 53s trunk passed
+1 💚 shadedclient 16m 4s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 17s the patch passed
+1 💚 compile 0m 16s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javac 0m 16s the patch passed
+1 💚 compile 0m 16s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 javac 0m 16s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 12s the patch passed
+1 💚 mvnsite 0m 20s the patch passed
+1 💚 javadoc 0m 16s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 0m 16s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 0m 38s the patch passed
+1 💚 shadedclient 15m 2s patch has no errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 9m 57s /patch-unit-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-router.txt hadoop-yarn-server-router in the patch passed.
+1 💚 asflicense 0m 22s The patch does not generate ASF License warnings.
75m 25s
Reason Tests
Failed junit tests hadoop.yarn.server.router.webapp.TestFederationWebApp
Subsystem Report/Notes
Docker ClientAPI=1.55 ServerAPI=1.55 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/3/artifact/out/Dockerfile
GITHUB PR #8681
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 53db6b1cf60e 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 / 4fddd6f
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-8681/3/testReport/
Max. process+thread count 1286 (vs. ulimit of 10000)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/3/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.

@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 6m 37s 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 2 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 25m 46s trunk passed
+1 💚 compile 0m 38s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 compile 0m 35s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 checkstyle 0m 35s trunk passed
+1 💚 mvnsite 0m 39s trunk passed
+1 💚 javadoc 0m 37s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 0m 37s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 0m 53s trunk passed
+1 💚 shadedclient 15m 51s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 19s the patch passed
+1 💚 compile 0m 17s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javac 0m 17s the patch passed
+1 💚 compile 0m 16s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 javac 0m 16s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 14s the patch passed
+1 💚 mvnsite 0m 18s the patch passed
+1 💚 javadoc 0m 16s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 0m 16s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 0m 36s the patch passed
+1 💚 shadedclient 15m 14s patch has no errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 10m 12s /patch-unit-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-router.txt hadoop-yarn-server-router in the patch passed.
-1 ❌ asflicense 0m 23s /results-asflicense.txt The patch generated 1 ASF License warnings.
82m 41s
Reason Tests
Failed junit tests hadoop.yarn.server.router.webapp.TestFederationWebApp
Subsystem Report/Notes
Docker ClientAPI=1.55 ServerAPI=1.55 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/4/artifact/out/Dockerfile
GITHUB PR #8681
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 48082d956e6b 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 322d963
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-8681/4/testReport/
Max. process+thread count 1312 (vs. ulimit of 10000)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/4/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.

@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 22s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s 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 2 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 26m 29s trunk passed
+1 💚 compile 0m 33s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 compile 0m 38s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 checkstyle 0m 35s trunk passed
+1 💚 mvnsite 0m 39s trunk passed
+1 💚 javadoc 0m 36s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 0m 37s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 0m 54s trunk passed
+1 💚 shadedclient 15m 45s branch has no errors when building and testing our client artifacts.
-0 ⚠️ patch 16m 4s Used diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 19s the patch passed
+1 💚 compile 0m 18s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javac 0m 18s the patch passed
+1 💚 compile 0m 16s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 javac 0m 16s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 13s the patch passed
+1 💚 mvnsite 0m 19s the patch passed
+1 💚 javadoc 0m 17s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 0m 16s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 0m 37s the patch passed
+1 💚 shadedclient 15m 22s patch has no errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 10m 52s /patch-unit-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-router.txt hadoop-yarn-server-router in the patch passed.
+1 💚 asflicense 0m 24s The patch does not generate ASF License warnings.
77m 46s
Reason Tests
Failed junit tests hadoop.yarn.server.router.webapp.TestRouterWebServicesREST
Subsystem Report/Notes
Docker ClientAPI=1.55 ServerAPI=1.55 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/5/artifact/out/Dockerfile
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux c559eba99fb9 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / abbc78d
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-8681/5/testReport/
Max. process+thread count 1304 (vs. ulimit of 10000)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/5/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.

@joseluisll

joseluisll commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor Author

The tests in the -1 unit fail on clean trunk as well.

I ran TestRouterWebServicesREST three times on unpatched trunk, at the same
revision this precommit used (abbc78d4416):

failures / 42
trunk, run 1 2
trunk, run 2 1
trunk, run 3 3
this patch 1

Same code, different results each run, always among testAppAttemptXML,
testAppXML and testGetAppsMultiThread. Trunk fails more often than the patch.

The cause is a race in the test: getAppAttempt reads getAttempts().get(0)
right after submitApplication() without waiting, so if the RM has not created
the attempt yet the list is empty. That is the IndexOutOfBounds: Index 0 out of bounds for length 0 in the precommit log.

TestFederationWebApp extends that class and fails the same way.
TestYarnFederationWithFairScheduler, the third name in the report, passes 38/38.

The suite this JIRA fixes, TestYarnFederationWithCapacityScheduler, passes 38/38.
Its child JVMs run the shutdown hooks to completion, stop the token remover and
the SubClusterCleaner, and close every ZooKeeper session they open.

@slfan1989 could you take another look when you have time?

@hadoop-yetus

Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 24s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s 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 2 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 30m 5s trunk passed
+1 💚 compile 0m 36s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 compile 0m 37s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 checkstyle 0m 35s trunk passed
+1 💚 mvnsite 0m 30s trunk passed
+1 💚 javadoc 0m 38s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 0m 33s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 0m 45s trunk passed
+1 💚 shadedclient 17m 36s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 20s the patch passed
+1 💚 compile 0m 15s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javac 0m 15s the patch passed
+1 💚 compile 0m 17s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 javac 0m 17s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 12s the patch passed
+1 💚 mvnsite 0m 19s the patch passed
+1 💚 javadoc 0m 17s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 0m 14s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 0m 42s the patch passed
+1 💚 shadedclient 17m 48s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 9m 43s hadoop-yarn-server-router in the patch passed.
+1 💚 asflicense 0m 25s The patch does not generate ASF License warnings.
84m 40s
Subsystem Report/Notes
Docker ClientAPI=1.55 ServerAPI=1.55 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/6/artifact/out/Dockerfile
GITHUB PR #8681
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 9b8c21fe3ada 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 9ff0cc6
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-8681/6/testReport/
Max. process+thread count 1302 (vs. ulimit of 10000)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/6/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.

@joseluisll

joseluisll commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor Author

@pan3793 @slfan1989 may you review and give way to this as the latest psrt of the cluster leak testing improvement?

@joseluisll

joseluisll commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor Author

@pan3793 @slfan1989 This PR is Green and ready to merge!. With this, the cluster leak improvement is finished.

@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 6m 58s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s 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 2 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 27m 58s trunk passed
+1 💚 compile 0m 35s trunk passed with JDK Ubuntu-21.0.12+8-1-24.04-Ubuntu
+1 💚 compile 0m 37s trunk passed with JDK Ubuntu-17.0.20+8-1-24.04-Ubuntu
+1 💚 checkstyle 0m 35s trunk passed
+1 💚 mvnsite 0m 37s trunk passed
+1 💚 javadoc 0m 39s trunk passed with JDK Ubuntu-21.0.12+8-1-24.04-Ubuntu
+1 💚 javadoc 0m 37s trunk passed with JDK Ubuntu-17.0.20+8-1-24.04-Ubuntu
+1 💚 spotbugs 0m 54s trunk passed
+1 💚 shadedclient 16m 6s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 19s the patch passed
+1 💚 compile 0m 18s the patch passed with JDK Ubuntu-21.0.12+8-1-24.04-Ubuntu
+1 💚 javac 0m 18s the patch passed
+1 💚 compile 0m 16s the patch passed with JDK Ubuntu-17.0.20+8-1-24.04-Ubuntu
+1 💚 javac 0m 16s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 13s the patch passed
+1 💚 mvnsite 0m 16s the patch passed
+1 💚 javadoc 0m 17s the patch passed with JDK Ubuntu-21.0.12+8-1-24.04-Ubuntu
+1 💚 javadoc 0m 16s the patch passed with JDK Ubuntu-17.0.20+8-1-24.04-Ubuntu
+1 💚 spotbugs 0m 37s the patch passed
+1 💚 shadedclient 15m 8s patch has no errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 9m 57s /patch-unit-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-server_hadoop-yarn-server-router.txt hadoop-yarn-server-router in the patch passed.
+1 💚 asflicense 0m 24s The patch does not generate ASF License warnings.
85m 16s
Reason Tests
Failed junit tests hadoop.yarn.server.router.webapp.TestFederationWebApp
Subsystem Report/Notes
Docker ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/7/artifact/out/Dockerfile
GITHUB PR #8681
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 1e6671410b87 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / fc8ac07
Default Java Ubuntu-17.0.20+8-1-24.04-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.12+8-1-24.04-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.20+8-1-24.04-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/7/testReport/
Max. process+thread count 1290 (vs. ulimit of 10000)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/7/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.

@hadoop-yetus

Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 22s 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 2 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 29m 21s trunk passed
+1 💚 compile 0m 37s trunk passed with JDK Ubuntu-21.0.12+8-1-24.04-Ubuntu
+1 💚 compile 0m 37s trunk passed with JDK Ubuntu-17.0.20+8-1-24.04-Ubuntu
+1 💚 checkstyle 0m 34s trunk passed
+1 💚 mvnsite 0m 40s trunk passed
+1 💚 javadoc 0m 34s trunk passed with JDK Ubuntu-21.0.12+8-1-24.04-Ubuntu
+1 💚 javadoc 0m 36s trunk passed with JDK Ubuntu-17.0.20+8-1-24.04-Ubuntu
+1 💚 spotbugs 0m 54s trunk passed
+1 💚 shadedclient 15m 59s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 19s the patch passed
+1 💚 compile 0m 18s the patch passed with JDK Ubuntu-21.0.12+8-1-24.04-Ubuntu
+1 💚 javac 0m 18s the patch passed
+1 💚 compile 0m 18s the patch passed with JDK Ubuntu-17.0.20+8-1-24.04-Ubuntu
+1 💚 javac 0m 18s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 12s the patch passed
+1 💚 mvnsite 0m 17s the patch passed
+1 💚 javadoc 0m 17s the patch passed with JDK Ubuntu-21.0.12+8-1-24.04-Ubuntu
+1 💚 javadoc 0m 15s the patch passed with JDK Ubuntu-17.0.20+8-1-24.04-Ubuntu
+1 💚 spotbugs 0m 39s the patch passed
+1 💚 shadedclient 15m 12s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 10m 22s hadoop-yarn-server-router in the patch passed.
+1 💚 asflicense 0m 24s The patch does not generate ASF License warnings.
80m 27s
Subsystem Report/Notes
Docker ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/8/artifact/out/Dockerfile
GITHUB PR #8681
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 4a02a67e8e53 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / b2f3860
Default Java Ubuntu-17.0.20+8-1-24.04-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.12+8-1-24.04-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.20+8-1-24.04-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/8/testReport/
Max. process+thread count 1300 (vs. ulimit of 10000)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/8/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.

@hadoop-yetus

Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 22s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s 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 5 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 25m 33s trunk passed
+1 💚 compile 0m 34s trunk passed with JDK Ubuntu-21.0.12+8-1-24.04-Ubuntu
+1 💚 compile 0m 37s trunk passed with JDK Ubuntu-17.0.20+8-1-24.04-Ubuntu
+1 💚 checkstyle 0m 35s trunk passed
+1 💚 mvnsite 0m 40s trunk passed
+1 💚 javadoc 0m 36s trunk passed with JDK Ubuntu-21.0.12+8-1-24.04-Ubuntu
+1 💚 javadoc 0m 38s trunk passed with JDK Ubuntu-17.0.20+8-1-24.04-Ubuntu
+1 💚 spotbugs 0m 50s trunk passed
+1 💚 shadedclient 15m 54s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 17s the patch passed
+1 💚 compile 0m 17s the patch passed with JDK Ubuntu-21.0.12+8-1-24.04-Ubuntu
+1 💚 javac 0m 17s the patch passed
+1 💚 compile 0m 18s the patch passed with JDK Ubuntu-17.0.20+8-1-24.04-Ubuntu
+1 💚 javac 0m 18s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 13s the patch passed
+1 💚 mvnsite 0m 17s the patch passed
+1 💚 javadoc 0m 14s the patch passed with JDK Ubuntu-21.0.12+8-1-24.04-Ubuntu
+1 💚 javadoc 0m 15s the patch passed with JDK Ubuntu-17.0.20+8-1-24.04-Ubuntu
+1 💚 spotbugs 0m 39s the patch passed
+1 💚 shadedclient 15m 34s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 8m 55s hadoop-yarn-server-router in the patch passed.
+1 💚 asflicense 0m 22s The patch does not generate ASF License warnings.
75m 3s
Subsystem Report/Notes
Docker ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/9/artifact/out/Dockerfile
GITHUB PR #8681
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 053a54be79de 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / f622780
Default Java Ubuntu-17.0.20+8-1-24.04-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.12+8-1-24.04-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.20+8-1-24.04-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/9/testReport/
Max. process+thread count 1313 (vs. ulimit of 10000)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/9/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.

@joseluisll joseluisll changed the title YARN-11984. Federation mock sub-cluster and router do not stop cleanly on SIGTERM. YARN-11984. Federation mock sub-cluster and router do not stop cleanly on SIGTERM and fix Router REST flaky tests Sep 26, 2026
@joseluisll

Copy link
Copy Markdown
Contributor Author

@slfan1989 @pan3793 @Hexiaoqiao This PR is ready for review. Let's improve testing of Hadoop!. Thanks in advance.

@joseluisll joseluisll changed the title YARN-11984. Federation mock sub-cluster and router do not stop cleanly on SIGTERM and fix Router REST flaky tests YARN-11984. Federation mock sub-cluster and router do not stop cleanly on SIGTERM Oct 3, 2026
@joseluisll joseluisll changed the title YARN-11984. Federation mock sub-cluster and router do not stop cleanly on SIGTERM YARN-11984 Federation mock sub-cluster and router do not stop cleanly on SIGTERM Oct 3, 2026
@github-actions github-actions Bot added the Infra label Oct 3, 2026
@joseluisll

Copy link
Copy Markdown
Contributor Author

I have narrowed the scope of the PR to just the SIGTERM fix, the fixes of flaky router tests is moved to specific new JIRA's

@joseluisll joseluisll left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@slfan1989 thanks for the review (review). The second-store issue is addressed: TestMockRouter no longer creates its own FederationStateStore.

Router#serviceInit already creates and initializes the facade's store (via SubClusterCleaner, which calls FederationStateStoreFacade#getInstance(Configuration)). So after router.init(conf) the mock now takes that same store with FederationStateStoreFacade.getInstance(conf).getStateStore() and registers the close hook on it. The Router process opens one ZooKeeper-backed store and the hook closes that one, with nothing orphaned by reinitialize(). The hook still runs at Router.SHUTDOWN_HOOK_PRIORITY - 5, after the Router's own hook, and is registered before router.start() so a failed start still closes the store.

Code: TestMockRouter.java#L86-L113

I've also narrowed this PR to the SIGTERM fix only: one commit, test code only. The Router flaky-test fixes and the two Router serviceStop fixes are moving to their own JIRAs. On Linux, TestYarnFederationWithCapacityScheduler passes 38/38, and all three child JVMs run their shutdown hooks and close their ZooKeeper sessions. Could you take another look?

@hadoop-yetus

Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 24s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s 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 4 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 26m 30s trunk passed
+1 💚 compile 0m 34s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 compile 0m 29s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 checkstyle 0m 31s trunk passed
+1 💚 mvnsite 0m 30s trunk passed
+1 💚 javadoc 0m 32s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 0m 31s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 spotbugs 0m 46s trunk passed
+1 💚 shadedclient 17m 48s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 17s the patch passed
+1 💚 compile 0m 15s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javac 0m 15s the patch passed
+1 💚 compile 0m 16s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 javac 0m 16s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 12s the patch passed
+1 💚 mvnsite 0m 15s the patch passed
+1 💚 javadoc 0m 15s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 0m 15s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 spotbugs 0m 41s the patch passed
+1 💚 shadedclient 19m 12s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 9m 23s hadoop-yarn-server-router in the patch passed.
+1 💚 asflicense 0m 21s The patch does not generate ASF License warnings.
81m 41s
Subsystem Report/Notes
Docker ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/11/artifact/out/Dockerfile
GITHUB PR #8681
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 01027fb5d649 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / bca85eb
Default Java Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/11/testReport/
Max. process+thread count 1297 (vs. ulimit of 10000)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/11/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.

@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 7m 16s 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.
+0 🆗 yamllint 0m 0s yamllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 4 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 2m 9s Maven dependency ordering for branch
+1 💚 mvninstall 27m 58s trunk passed
+1 💚 compile 9m 36s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 compile 9m 6s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 checkstyle 3m 13s trunk passed
+1 💚 mvnsite 11m 8s trunk passed
+1 💚 javadoc 5m 52s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 5m 56s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
-1 ❌ spotbugs 20m 27s /branch-spotbugs-root-warnings.html root in trunk has 81 extant spotbugs warnings.
+1 💚 shadedclient 15m 19s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 16s Maven dependency ordering for patch
+1 💚 mvninstall 21m 58s the patch passed
+1 💚 compile 8m 33s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javac 8m 33s the patch passed
+1 💚 compile 8m 53s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 javac 8m 53s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 3m 2s the patch passed
+1 💚 mvnsite 9m 49s the patch passed
+1 💚 javadoc 6m 5s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 5m 58s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 spotbugs 20m 13s the patch passed
+1 💚 shadedclient 34m 22s patch has no errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 628m 21s /patch-unit-root.txt root in the patch failed.
+1 💚 asflicense 1m 13s The patch does not generate ASF License warnings.
852m 12s
Reason Tests
Failed junit tests hadoop.yarn.server.router.webapp.TestFederationWebApp
Subsystem Report/Notes
Docker ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/10/artifact/out/Dockerfile
GITHUB PR #8681
Optional Tests dupname asflicense codespell detsecrets yamllint compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle
uname Linux 271ad71769cd 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 6f15ca9
Default Java Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/10/testReport/
Max. process+thread count 4442 (vs. ulimit of 10000)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router . U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/10/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.

@hadoop-yetus

Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 23s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s 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 4 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 28m 1s trunk passed
+1 💚 compile 0m 38s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 compile 0m 33s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 checkstyle 0m 37s trunk passed
+1 💚 mvnsite 0m 36s trunk passed
+1 💚 javadoc 0m 38s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 0m 34s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 spotbugs 0m 52s trunk passed
+1 💚 shadedclient 16m 11s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 19s the patch passed
+1 💚 compile 0m 16s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javac 0m 16s the patch passed
+1 💚 compile 0m 16s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 javac 0m 16s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 14s the patch passed
+1 💚 mvnsite 0m 19s the patch passed
+1 💚 javadoc 0m 17s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 0m 18s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 spotbugs 0m 38s the patch passed
+1 💚 shadedclient 15m 2s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 8m 40s hadoop-yarn-server-router in the patch passed.
+1 💚 asflicense 0m 23s The patch does not generate ASF License warnings.
77m 32s
Subsystem Report/Notes
Docker ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/12/artifact/out/Dockerfile
GITHUB PR #8681
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 9734249fd183 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 6fc79bf
Default Java Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/12/testReport/
Max. process+thread count 1310 (vs. ulimit of 10000)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/12/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.

@joseluisll

Copy link
Copy Markdown
Contributor Author

@slfan1989 CI and Yetus green, this PR is ready for review, after splitting and merging all YARN test fixes and spotbugs, only one part remain to finish the job: properly shutdown federation subcluster. Thank you in advance for your time.

@slfan1989 slfan1989 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update! The changes look reasonable, and the latest CI checks are green. I plan to merge #8784 and #8785 first so the Router’s background threads are stopped before the state store is closed, then proceed with this PR.

@slfan1989 slfan1989 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joseluisll Thanks for your patience! #8808 and #8785 have now been merged. Could you please rebase this PR onto the latest trunk and push the updated branch to trigger fresh CI runs? We can then continue the review and move this PR toward merging.

@slfan1989 slfan1989 changed the title YARN-11984 Federation mock sub-cluster and router do not stop cleanly on SIGTERM YARN-11984. Federation mock sub-cluster and router do not stop cleanly on SIGTERM Oct 10, 2026
…y on SIGTERM.

TestMockSubCluster and TestMockRouter are not tests - they have no @test
methods. TestFederationSubCluster launches them as separate JVMs through
JavaProcess and stops them with Process#destroy: SIGTERM on Linux and
macOS, which runs shutdown hooks. Neither registered one, so the JVM died
with its ResourceManager, NodeManagers and Router services still running:
no service stop, and the ZooKeeper session was left to expire on its own.
On Windows destroy maps to TerminateProcess, which runs no hooks, so
nothing changes there.

Both now register a CompositeServiceShutdownHook before init/start, so a
failure part-way through startup still tears down whatever came up.
Router#main already does exactly this; TestMockRouter starts the Router
directly and so skipped it. Each uses the shutdown hook priority of the
daemon it actually runs - ResourceManager's for the sub-cluster, Router's
for the router - which every YARN daemon defines as 30.

TestMockRouter additionally closes the ZooKeeper-backed
FederationStateStore, which the facade never closes; that hook runs at a
lower priority than the Router's - ShutdownHookManager runs the highest
priority first - so the Router is stopped before its store goes away. It
is registered once router.init() has returned and before router.start(),
so a failed start still closes the store. It closes the store the facade
already holds rather than building a second one: Router#serviceInit
creates a SubClusterCleaner whose constructor initializes the facade, and
reinitialize() swaps the reference without closing what it replaces, so a
second store would orphan the first. The Router process opens one
ZooKeeper session and closes it, rather than opening two and closing one.

The sub-cluster hook gets an explicit 90s budget. Its three NodeManagers
stop one after another, each waiting up to NM_PROCESS_KILL_WAIT_MS plus
1s (6s) for its applications to finish and then a hardcoded 10s in
DeletionService#serviceStop: about 48s in all, which ShutdownHookManager's
30s default would abandon part-way through. The NodeManagers SIGKILL
containers straight away instead of SIGTERM then SIGKILL, which these
long-lived mock clusters never need. NM_PROCESS_KILL_WAIT_MS keeps its
default: it also bounds how long a NodeManager waits for a container's
pid file before giving up on killing it, so zeroing it could leak
container processes.

TestFederationSubCluster#stop signals all three child JVMs before waiting
for any of them, so their shutdown hooks run concurrently rather than one
after another; JavaProcess gains destroy(), which signals without
waiting.

Not a mini-cluster leak (see YARN-11983): these clusters are meant to
outlive the method that starts them. The defect was unclean termination.

Test-scope only; no production code is touched. Verified on Linux with
TestYarnFederationWithCapacityScheduler: 38/38 pass, all three child JVMs
run their hooks to completion and close their ZooKeeper session, and no
hook hits its timeout. The suite costs 49s on trunk, 96s with the hooks.

Contains content generated by Claude Code.
Generated-by: Claude Code (Opus 5)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@hadoop-yetus

Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 31s 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 4 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 27m 17s trunk passed
+1 💚 compile 0m 35s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 compile 0m 36s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 checkstyle 0m 34s trunk passed
+1 💚 mvnsite 0m 38s trunk passed
+1 💚 javadoc 0m 38s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 0m 36s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 spotbugs 0m 54s trunk passed
+1 💚 shadedclient 15m 48s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 17s the patch passed
+1 💚 compile 0m 16s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javac 0m 16s the patch passed
+1 💚 compile 0m 18s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 javac 0m 18s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 13s the patch passed
+1 💚 mvnsite 0m 18s the patch passed
+1 💚 javadoc 0m 16s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 0m 17s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 spotbugs 0m 37s the patch passed
+1 💚 shadedclient 15m 18s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 8m 49s hadoop-yarn-server-router in the patch passed.
+1 💚 asflicense 0m 24s The patch does not generate ASF License warnings.
76m 56s
Subsystem Report/Notes
Docker ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/13/artifact/out/Dockerfile
GITHUB PR #8681
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 65dff775b4fc 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / da61fa9
Default Java Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/13/testReport/
Max. process+thread count 1256 (vs. ulimit of 10000)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8681/13/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.

@joseluisll
joseluisll requested a review from slfan1989 October 10, 2026 13:44
@joseluisll

Copy link
Copy Markdown
Contributor Author

@joseluisll Thanks for your patience! #8808 and #8785 have now been merged. Could you please rebase this PR onto the latest trunk and push the updated branch to trigger fresh CI runs? We can then continue the review and move this PR toward merging.

Done!

@slfan1989 slfan1989 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for rebasing! The previous lifecycle concerns have been addressed, and the latest branch includes both Router shutdown fixes. The latest GitHub Actions and Yetus checks are green. LGTM, ready to merge.

@slfan1989
slfan1989 merged commit 16aa234 into apache:trunk Oct 11, 2026
6 checks passed
@slfan1989

Copy link
Copy Markdown
Contributor

@joseluisll Thanks for the contribution! Merged into trunk.

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