apache/incubator-spark — pull request #556 by CodingCat (2014-02-07 02:57:23+00:00)
Title: [SPARK-1060] startJettyServer should explicitly use IP information

https://spark-project.atlassian.net/browse/SPARK-1060

In the current implementation, the webserver in Master/Worker is started with

val (srv, bPort) = JettyUtils.startJettyServer("0.0.0.0", port, handlers)

(inside startJettyServer)

val server = new Server(currentPort) //the Server will take "0.0.0.0" as the hostname, i.e. will always
bind to the IP address of the first NIC, which is actually not using host information got by "val host = Utils.localHostName()" in JettyUtil

this can cause wrong IP binding, e.g. if the host has two NICs, N1 and N2, the user specify the SPARK_LOCAL_IP as the N2's IP address, however, when starting the web server, for the reason stated above, it will always bind to the N1's address