Nflrijal commented on code in PR #58243:
URL: https://github.com/apache/spark/pull/58243#discussion_r3945734024


##########
core/src/main/scala/org/apache/spark/SparkContext.scala:
##########
@@ -636,8 +638,19 @@ class SparkContext(config: SparkConf) extends Logging {
     }
 
     if (_conf.get(UI_REVERSE_PROXY)) {
-      val proxyUrl = 
_conf.get(UI_REVERSE_PROXY_URL).getOrElse("").stripSuffix("/")
-      System.setProperty("spark.ui.proxyBase", proxyUrl + "/proxy/" + 
_applicationId)
+      _previousProxyBase = sys.props.get("spark.ui.proxyBase")
+      val baseProxyUrl = _conf.get(UI_REVERSE_PROXY_URL)
+        .orElse(_previousProxyBase)

Review Comment:
    Added isAppSpecificProxyBase in SparkContext to filter out 
application-specific proxy paths (such as YARN AM /proxy/application_... or 
Standalone /proxy/app-...) when capturing _previousProxyBase. When a Standalone 
client context starts after a YARN context in the same JVM, it ignores the 
leftover YARN application path and generates /proxy/<new-id> directly. Added 
unit test in SparkContextSuite covering the YARN to Standalone context 
transition.



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