This is an automated email from the ASF dual-hosted git repository.

gengliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 23f4a65  [SPARK-36433][WEBUI] Fix log message in WebUI
23f4a65 is described below

commit 23f4a650ea2a1cdd136b9857627e42fa6c5ba107
Author: Thejdeep Gudivada <tgudiv...@linkedin.com>
AuthorDate: Thu Sep 16 17:26:56 2021 +0800

    [SPARK-36433][WEBUI] Fix log message in WebUI
    
    ### What changes were proposed in this pull request?
    
    This fixes the info log message output when starting a WebUI server
    
    ### Why are the changes needed?
    This is needed by the user to go to the right location of the started 
service
    ```
    21/08/05 14:33:30 INFO HistoryServer: Bound HistoryServer to 0.0.0.0, and 
started at http://tgudivad-mn1.test.biz:18080
    ```
    
    ### Does this PR introduce _any_ user-facing change?
    Yes, fixes the URL displayed in the logs when starting the service.
    
    ### How was this patch tested?
    Tested by running an instance of HistoryServer
    
    Closes #33659 from thejdeep/SPARK-36433.
    
    Authored-by: Thejdeep Gudivada <tgudiv...@linkedin.com>
    Signed-off-by: Gengliang Wang <gengli...@apache.org>
---
 core/src/main/scala/org/apache/spark/ui/WebUI.scala | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/core/src/main/scala/org/apache/spark/ui/WebUI.scala 
b/core/src/main/scala/org/apache/spark/ui/WebUI.scala
index 80723c3..4a49b98 100644
--- a/core/src/main/scala/org/apache/spark/ui/WebUI.scala
+++ b/core/src/main/scala/org/apache/spark/ui/WebUI.scala
@@ -142,7 +142,6 @@ private[spark] abstract class WebUI(
   def initServer(): ServerInfo = {
     val host = Option(conf.getenv("SPARK_LOCAL_IP")).getOrElse("0.0.0.0")
     val server = startJettyServer(host, port, sslOptions, conf, name, poolSize)
-    logInfo(s"Bound $className to $host, and started at $webUrl")
     server
   }
 
@@ -150,9 +149,11 @@ private[spark] abstract class WebUI(
   def bind(): Unit = {
     assert(serverInfo.isEmpty, s"Attempted to bind $className more than once!")
     try {
+      val host = Option(conf.getenv("SPARK_LOCAL_IP")).getOrElse("0.0.0.0")
       val server = initServer()
       handlers.foreach(server.addHandler(_, securityManager))
       serverInfo = Some(server)
+      logInfo(s"Bound $className to $host, and started at $webUrl")
     } catch {
       case e: Exception =>
         logError(s"Failed to bind $className", e)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to