Skip to content

Commit 1f25d23

Browse files
committed
add comment
1 parent 0d12249 commit 1f25d23

File tree

1 file changed

+6
-4
lines changed
  • core/src/main/scala/org/apache/spark/deploy/worker

1 file changed

+6
-4
lines changed

core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,12 @@ private[deploy] class Worker(
278278
if (reverseProxy) {
279279
logInfo("WorkerWebUI is available at %s/proxy/%s".format(
280280
activeMasterWebUiUrl.stripSuffix("/"), workerId))
281-
// if reverseProxyUrl is not set, then we continue to generate relative URLs
282-
// starting with "/" throughout the UI and do not use activeMasterWebUiUrl
283-
val proxyUrl = conf.get(UI_REVERSE_PROXY_URL.key, "").stripSuffix("/")
284-
System.setProperty("spark.ui.proxyBase", proxyUrl)
281+
// if reverseProxyUrl is not set, then we continue to generate relative URLs
282+
// starting with "/" throughout the UI and do not use activeMasterWebUiUrl
283+
val proxyUrl = conf.get(UI_REVERSE_PROXY_URL.key, "").stripSuffix("/")
284+
// In the method `UIUtils.makeHref`, the URL segment "/proxy/$worker_id" will be appended
285+
// after `proxyUrl`, so no need to set the worker ID in the `spark.ui.proxyBase` here.
286+
System.setProperty("spark.ui.proxyBase", proxyUrl)
285287
}
286288
// Cancel any outstanding re-registration attempts because we found a new master
287289
cancelLastRegistrationRetry()

0 commit comments

Comments
 (0)