Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/21816#discussion_r221635335
--- Diff:
core/src/main/scala/org/apache/spark/deploy/rest/StandaloneRestServer.scala ---
@@ -138,6 +138,16 @@ private[rest] class StandaloneSubmitRequestServlet(
val driverExtraClassPath =
sparkProperties.get("spark.driver.extraClassPath")
val driverExtraLibraryPath =
sparkProperties.get("spark.driver.extraLibraryPath")
val superviseDriver = sparkProperties.get("spark.driver.supervise")
+ // The semantics of "spark.master" and the masterUrl are different.
While the
+ // property "spark.master" could contain all registered masters,
masterUrl
+ // contains only the active master. To make sure a Spark driver can
recover
+ // in a multi-master setup, we use the "spark.master" property while
submitting
+ // the driver.
+ val masters = sparkProperties.get("spark.master")
+ val (_, masterPort) = Utils.extractHostPortFromSparkUrl(masterUrl)
+ val masterRestPort = this.conf.getInt("spark.master.rest.port", 6066)
+ val updatedMasters = masters.map(
+ _.replace(masterRestPort.toString,
masterPort.toString)).getOrElse(masterUrl)
--- End diff --
Is there a risk that the port number occurs in the host name too? it would
be replaced in this case as well. I wonder if it's safer to replace ":1234"
with ":5678", with the colon, to make sure it doesn't match the hostname?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]