You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/08/09 23:44:18 UTC

[GitHub] [spark] dongjoon-hyun commented on a diff in pull request #37456: [SPARK-39559][CORE][FOLLOWUP] Use INADDR_ANY and IN6ADDR_ANY in WebUI

dongjoon-hyun commented on code in PR #37456:
URL: https://github.com/apache/spark/pull/37456#discussion_r941889500


##########
core/src/main/scala/org/apache/spark/ui/WebUI.scala:
##########
@@ -140,7 +140,8 @@ private[spark] abstract class WebUI(
   def initialize(): Unit
 
   def initServer(): ServerInfo = {
-    val hostName = Utils.localHostNameForURI()
+    val hostName = Option(conf.getenv("SPARK_LOCAL_IP"))
+        .getOrElse(if (Utils.preferIPv6) "[::]" else "0.0.0.0")

Review Comment:
   This is identical with the previous behavior for IPv4 behavior and extended for IPv6.



##########
core/src/main/scala/org/apache/spark/ui/WebUI.scala:
##########
@@ -152,7 +153,9 @@ private[spark] abstract class WebUI(
       val server = initServer()
       handlers.foreach(server.addHandler(_, securityManager))
       serverInfo = Some(server)
-      logInfo(s"Bound $className to ${Utils.localHostNameForURI()}, and started at $webUrl")
+      val hostName = Option(conf.getenv("SPARK_LOCAL_IP"))
+          .getOrElse(if (Utils.preferIPv6) "[::]" else "0.0.0.0")

Review Comment:
   ditto.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org