Skip to content

YARN-12049. Close Router RMAdmin interceptor pipelines and thread pools on shutdown - #8884

Closed
luoyuan3471 wants to merge 1 commit into
apache:trunkfrom
luoyuan3471:codex/yarn-rmadmin-pipeline-cleanup
Closed

luoyuan3471 wants to merge 1 commit into
apache:trunkfrom
luoyuan3471:codex/yarn-rmadmin-pipeline-cleanup

Conversation

@luoyuan3471

@luoyuan3471 luoyuan3471 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Problem

FederationRMAdminInterceptor creates a per-user thread pool but does not shut
it down. RouterRMAdminService clears cached interceptor pipelines on stop
without closing them, and failed pipeline initialization can leave an
already-created executor open. With core thread timeout disabled, used worker
threads can remain alive after the owning pipeline should have been shut down.

Solution

  • Shut down the executor in FederationRMAdminInterceptor, including safe shutdown before initialization.
  • Give the pipeline wrapper an idempotent close() method and close cached pipelines explicitly on service stop.
  • Close partially initialized pipelines when initialization fails.
  • Continue closing other cached pipelines if one shutdown throws.
  • Retain the existing finalization fallback for evicted pipelines; eviction does not immediately close a pipeline that may still be in use.

Validation

  • Local tests passed with JDK 17 and Maven 3.9.15.
  • TestRouterRMAdminService: 8 tests, 0 failures, 0 errors, 0 skipped.
  • TestFederationRMAdminInterceptor: 38 tests, 0 failures, 0 errors, 0 skipped.
  • Coverage includes worker termination, shutdown before initialization, service stop before start, cached pipeline closure, repeated closure and finalization, shutdown exceptions, initialization failure, and the eviction cleanup fallback.
  • Surefire reports and git diff --check verified.
  • Checkstyle comparison against the same unmodified trunk baseline found 21 existing violations in each, with no new violations.

Related Jira

YARN-12049

@luoyuan3471
luoyuan3471 marked this pull request as draft October 29, 2026 07:51
@hadoop-yetus

Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 6m 52s 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 35s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 compile 0m 39s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 checkstyle 0m 38s trunk passed
+1 💚 mvnsite 0m 38s trunk passed
+1 💚 javadoc 0m 34s trunk passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javadoc 0m 37s trunk passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 spotbugs 0m 52s trunk passed
+1 💚 shadedclient 16m 5s branch has no errors when building and testing our client artifacts.
-0 ⚠️ patch 16m 24s 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 17s the patch passed
+1 💚 compile 0m 13s the patch passed with JDK Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu
+1 💚 javac 0m 13s the patch passed
+1 💚 compile 0m 17s the patch passed with JDK Ubuntu-17.0.20.1+1-1-24.04-Ubuntu
+1 💚 javac 0m 17s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 14s the patch passed
+1 💚 mvnsite 0m 16s the patch passed
+1 💚 javadoc 0m 18s 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 42s the patch passed
+1 💚 shadedclient 15m 28s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 8m 51s hadoop-yarn-server-router in the patch passed.
+1 💚 asflicense 0m 23s The patch does not generate ASF License warnings.
83m 14s
Subsystem Report/Notes
Docker ClientAPI=1.56 ServerAPI=1.56 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8884/1/artifact/out/Dockerfile
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux ad327c637265 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 / a2d306c
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-8884/1/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-8884/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.

@luoyuan3471

Copy link
Copy Markdown
Contributor Author

Superseded by #8887, which narrows YARN-12049 to shutting down the FederationRMAdminInterceptor thread pool and its regression tests. The broader pipeline lifecycle changes are not included in the replacement PR.

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