sunchao commented on code in PR #58243:
URL: https://github.com/apache/spark/pull/58243#discussion_r3963417683
##########
core/src/main/scala/org/apache/spark/SparkContext.scala:
##########
@@ -2405,9 +2419,24 @@ class SparkContext(config: SparkConf) extends Logging {
ResourceProfile.clearDefaultProfile()
// Unset YARN mode system env variable, to allow switching between cluster
types.
SparkContext.clearActiveContext()
+ if (_proxyBaseSetByContext) {
+ _previousProxyBase match {
+ case Some(oldBase) if !isAppSpecificProxyBase(oldBase) =>
+ System.setProperty("spark.ui.proxyBase", oldBase)
+ case _ =>
+ System.clearProperty("spark.ui.proxyBase")
Review Comment:
[P2] Finish proxy cleanup before allowing a replacement context
`stop()` clears the active-context registration before restoring
`spark.ui.proxyBase`. Another thread can start a replacement context during
that gap; the old shutdown then overwrites its new proxy prefix.
I reproduced this with a controlled interleaving. Even with a correct
forwarding header, the replacement generated `/deployment-before/jobs/` instead
of its application-specific URL. The parent control preserved the replacement’s
prefix. Ordinary sequential restarts pass.
Move proxy-property cleanup before `clearActiveContext()`.
--
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]