Nflrijal opened a new pull request, #58243:
URL: https://github.com/apache/spark/pull/58243

   ### What changes were proposed in this pull request?
   When `spark.ui.reverseProxy=true` is enabled in Standalone multi-cluster 
deployments:
   1. `SparkContext` on the driver did not receive `UI_REVERSE_PROXY_URL`, 
causing driver UI links to drop `/proxy/<id>` prefixes. This PR propagates 
`UI_REVERSE_PROXY_URL` (or falls back to `spark.ui.proxyBase`) into system 
property `spark.ui.proxyBase`.
   2. `Master` did not pass `-Dspark.ui.reverseProxyUrl=<url>` to 
`DriverDescription` `javaOpts`. This PR updates `Master` to inject 
`reverseProxyUrl` into driver `javaOpts` when reverse proxy is enabled.
   3. `/app/kill` and `/driver/kill` redirect `Location` headers were 
redirecting to `/` instead of `reverseProxyUrl + "/"`. This PR updates 
`MasterWebUI` redirect handlers to preserve reverse proxy paths.
   4. `UIUtils.prependBaseUri` and `uiRoot` were updated to handle `request = 
null` safely.
   
   *Note: Please backport to `master`, `branch-4.1`, and `branch-3.5` if 
applicable.*
   
   ### Why are the changes needed?
   Without these changes, multi-cluster reverse proxy deployments lose proxy 
prefixes when accessing driver UIs or terminating applications/drivers from 
Master UI, breaking navigation and reverse proxy routing.
   
   ### Does this PR introduce _any_ user-facing change?
   No API changes. Fixes UI navigation links and redirect Location headers when 
`spark.ui.reverseProxy=true` is enabled.
   
   ### How was this patch tested?
   - Added unit tests in `UIUtilsSuite`, `MasterSuite`, `MasterWebUISuite`, and 
`SparkContextSuite`.
   - Verified local build and unit tests using `build/sbt "core/testOnly 
org.apache.spark.ui.UIUtilsSuite org.apache.spark.deploy.master.MasterSuite 
org.apache.spark.deploy.master.ui.MasterWebUISuite 
org.apache.spark.SparkContextSuite"`.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   No.


-- 
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]

Reply via email to