joseluisll opened a new pull request, #8840: URL: https://github.com/apache/hadoop/pull/8840
### Description of PR JIRA: https://issues.apache.org/jira/browse/YARN-12024 Resource profiles are disabled by default, so each RM's `getResourceProfiles` and `getResourceProfile` throw `YARNFeatureNotEnabledException`. That exception is part of the API contract: the distributed shell `Client` catches it and carries on without profiles. Through the Router the client gets a plain `YarnException` instead, so the submission fails. The type is lost in two places: - `FederationClientInterceptor#invokeConcurrent` replaces the per-sub-cluster failures with `new YarnException("invokeConcurrent Failed = " + ...)`, which has no cause. Callers can't recover the original exception. - `getResourceProfiles` and `getResourceProfile` wrap whatever `invokeConcurrent` throws in another `YarnException` via `RouterServerUtil.logAndThrowException`. Changes: - `invokeConcurrent` throws `YARNFeatureNotEnabledException`, with the same message, when every failed sub-cluster reported it. Failures that are mixed with other errors are still reported as a plain `YarnException`. - `getResourceProfiles` and `getResourceProfile` record the failure metric and audit log as before, then rethrow `YARNFeatureNotEnabledException` without wrapping it. - New `TestFederationClientInterceptorProfilesDisabled` runs the interceptor against two MockRM sub-clusters with profiles disabled. `TestableFederationClientInterceptor` can't be used for this: its MockRMs read the module's test `yarn-site.xml` in their constructor, which enables profiles. ### How was this patch tested? On Ubuntu 24.04 (WSL2), OpenJDK 17, Maven 3.9.16: - `mvn -pl hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router -am test -Dtest='TestFederationClientInterceptorProfilesDisabled,TestFederationClientInterceptor,TestFederationClientInterceptorRetry' -Dsurefire.failIfNoSpecifiedTests=false -Dmaven.test.failure.ignore=false`: 78 tests run, 0 failures, 0 errors, 2 skipped (both skips are already on trunk). - With the `FederationClientInterceptor` change reverted, `TestFederationClientInterceptorProfilesDisabled#testRouterReportsFeatureNotEnabled` fails with `expected: <org.apache.hadoop.yarn.exceptions.YARNFeatureNotEnabledException> but was: <org.apache.hadoop.yarn.exceptions.YarnException>`. - Checkstyle: no violations on the changed files. ### For code changes: - [x] 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? (Not applicable: no object storage changes.) - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? (Not applicable: no new dependencies.) - [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`, `NOTICE-binary` files? (Not applicable.) ### AI Tooling If an AI tool was used: - [x] The PR includes the phrase "Contains content generated by <tool>" where <tool> is the name of the AI tool used. - [x] My use of AI contributions follows the ASF legal policy https://www.apache.org/legal/generative-tooling.html Contains content generated by Claude Code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
