rajatahujaatinmobi commented on a change in pull request #28880:
URL: https://github.com/apache/spark/pull/28880#discussion_r444633578



##########
File path: 
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
##########
@@ -211,9 +211,11 @@ private[spark] class ApplicationMaster(
   final def run(): Int = {
     try {
       val attemptID = if (isClusterMode) {
-        // Set the web ui port to be ephemeral for yarn so we don't conflict 
with
-        // other spark processes running on the same box
-        System.setProperty(UI_PORT.key, "0")
+        // Set the web ui port to be ephemeral for yarn if not set explicitly
+        // so we don't conflict with other spark processes running on the same 
box
+        if (System.getProperty(UI_PORT.key) != null) {
+          System.setProperty(UI_PORT.key, "0")
+        }

Review comment:
       I blocked ports from **18000 to 18050 s**o now spark.ui.port can not get 
port b/w that range. But in Spark properties, I mentioned  **spark.ui.port as 
18018 and spark.port.maxRetries=60** so now spark service will start trying 
from 18018 port until **18018 + 60** in an increment way but ports are blocked 
until 18050 so spark.ui.port will pick up **18051** port. 

##########
File path: 
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
##########
@@ -211,9 +211,11 @@ private[spark] class ApplicationMaster(
   final def run(): Int = {
     try {
       val attemptID = if (isClusterMode) {
-        // Set the web ui port to be ephemeral for yarn so we don't conflict 
with
-        // other spark processes running on the same box
-        System.setProperty(UI_PORT.key, "0")
+        // Set the web ui port to be ephemeral for yarn if not set explicitly
+        // so we don't conflict with other spark processes running on the same 
box
+        if (System.getProperty(UI_PORT.key) != null) {
+          System.setProperty(UI_PORT.key, "0")
+        }

Review comment:
       I blocked ports from **18000 to 18050 s**o now spark.ui.port can not get 
port b/w that range. But in Spark properties, I mentioned  **spark.ui.port as 
18018 and spark.port.maxRetries=60** so now spark service will start trying 
from 18018 port until **18018 + 60** in an increment way but ports are blocked 
until 18050 so spark.ui.port will pick up **18051** port. @Ngone51 




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to