Repository navigation
[Console] Fix YARN RM REST endpoints being routed to web proxy - #4524
Open
songchaolin wants to merge 1 commit into
Open
songchaolin wants to merge 1 commit into
songchaolin wants to merge 1 commit into
Conversation
The YARN web proxy (yarn.web-proxy.address) only serves /proxy/... paths and does not expose the ResourceManager-only REST endpoints such as ws/v1/cluster/apps/.... getRMWebAppURL() always prefers yarn.web-proxy.address, so those RM-only calls failed with 404 and job states were never detected. Introduce getRMWebAppRestURL() which resolves the ResourceManager web app address (yarn.resourcemanager.webapp.address) via getSocketAddr, and route ws/v1/* requests to it in restRequest() while keeping /proxy/* UI paths on the web proxy. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Problem
When
yarn.web-proxy.addressis configured (a common setup on managed YARN clusters such as Alibaba EMR),YarnUtils.getRMWebAppURL()always prefers the web proxy address over the ResourceManager's own web app address.The YARN web proxy only serves
/proxy/...paths — it does not expose the ResourceManager-only REST endpoints such asws/v1/cluster/apps/{id}. As a result,restRequest(ws/v1/cluster/apps/...)returns404,getFromYarnRestApithrows, and a FAILED application is never detected (it keeps showing as RUNNING and no alert is fired), even though the RM reportsfinalStatus=FAILED.Reproduction
On a cluster where
yarn.web-proxy.addressdiffers fromyarn.resourcemanager.webapp.address:curl http://<RM_HOST>:8088/ws/v1/cluster/apps/returns the app withfinalStatus: FAILED, whilehttp://<PROXY_HOST>:<PORT>/ws/v1/cluster/apps/returns404.Fix
YarnUtils.getRMWebAppRestURL()that resolves the RM web app address (yarn.resourcemanager.webapp.address/..._HTTPS_ADDRESS) viagetSocketAddr, reusing the default port constants (YarnConfiguration.DEFAULT_RM_WEBAPP_PORT), so no port is hard-coded.restRequest(), routews/v1*(RM-only REST) requests togetRMWebAppRestURL()while keeping all other relative paths (e.g./proxy/...) on the existing web-proxy base URL. UI proxying is unaffected.Tests
Compiled with JDK 11 (
mvn -pl streampark-common compile-> BUILD SUCCESS). Verified in production: the FAILED state is now detected and the alert fires.