Yuan Luo created YARN-12049:
-------------------------------
Summary: Close Router RMAdmin interceptor pipelines and thread
pools on shutdown
Key: YARN-12049
URL: https://issues.apache.org/jira/browse/YARN-12049
Project: Hadoop YARN
Issue Type: Bug
Components: federation
Reporter: Yuan Luo
h3. Problem
FederationRMAdminInterceptor creates a per-user ThreadPoolExecutor but inherits
a shutdown method that only delegates to the next interceptor. Its executor is
never shut down. RouterRMAdminService also clears cached interceptor pipelines
on stop without closing them, leaving cleanup to finalization. A failed
pipeline initialization can likewise 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.
h3. Solution
Shut down the executor in FederationRMAdminInterceptor. Give the pipeline
wrapper an idempotent close method, invoke it for cached pipelines during
service stop, and close partially initialized pipelines on initialization
failure. Continue closing other cached pipelines if one shutdown throws. Retain
the existing finalization fallback for evicted pipelines so eviction does not
immediately shut down a pipeline still used by a request.
h3. Validation
JDK 17: TestRouterRMAdminService and the
testShutdownThreadPool/testShutdownBeforeInit methods in
TestFederationRMAdminInterceptor passed: 10 tests, zero failures or errors.
Coverage includes worker termination, repeated closure, a shutdown exception,
failed initialization, stop before start, and the existing eviction cleanup
fallback.
Source baseline: Apache trunk a2d306c65a84bdf11a6eb5251cfff1bfe110546e.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]