PLAT-144996: Fixing spark ui base path url#14
Open
c3-rohithbandaru wants to merge 1 commit intoexm-develop-spark-v3.5from
Open
PLAT-144996: Fixing spark ui base path url#14c3-rohithbandaru wants to merge 1 commit intoexm-develop-spark-v3.5from
c3-rohithbandaru wants to merge 1 commit intoexm-develop-spark-v3.5from
Conversation
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.
Summary
Fixes Spark UI when served behind a reverse proxy at a custom base path (spark.ui.proxyBasePath). Previously, internal redirects and API endpoints ignored the base path, causing 302s to wrong URLs and 404s.
What changed:
JettyUtils -- Redirect handlers now derive basePath from the request context and emit relative Location headers instead of absolute URLs pointing at the internal Spark address. Added ProxyRedirectHandler awareness of uiRoot for pre-dispatch redirects.
ApiRootResource -- REST API (/api) mounts under basePath so it's reachable at /api.
PrometheusResource -- Left untouched; /metrics always mounts at root (no proxy path needed).
SparkUI / SparkContext / UI.scala -- Reads new spark.ui.proxyBasePath config, threads basePath through to all handler and redirect registrations.
UIUtils -- uiRoot / prependBaseUri cleaned up; removed noisy per-request logging