You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "cxzl25 (via GitHub)" <gi...@apache.org> on 2023/10/30 06:38:01 UTC

[PR] [SPARK-45717][YARN] Avoid use `spark.yarn.user.classpath.first` [spark]

cxzl25 opened a new pull request, #43579:
URL: https://github.com/apache/spark/pull/43579

   ### What changes were proposed in this pull request?
   Use `spark.driver.userClassPathFirst` instead of `spark.yarn.user.classpath.first`.
   
   ### Why are the changes needed?
   When we set `spark.yarn.user.classpath.first=true`, we get the following message.
   ```
   23/10/30 14:32:16.855 pool-1-thread-1-ScalaTest-running-ClientSuite 
   WARN SparkConf: The configuration key 'spark.yarn.user.classpath.first' has been deprecated as of Spark 1.3 and may be removed in the future. Please use spark.{driver,executor}.userClassPathFirst instead. 
   ```
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### How was this patch tested?
   exist UT
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   No


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


Re: [PR] [SPARK-45717][YARN] Avoid use `spark.yarn.user.classpath.first` [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #43579:
URL: https://github.com/apache/spark/pull/43579#issuecomment-2104947313

   cc @mridulm , too


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


Re: [PR] [SPARK-45717][YARN] Avoid use `spark.yarn.user.classpath.first` [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #43579:
URL: https://github.com/apache/spark/pull/43579#discussion_r1596997363


##########
resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/ClientSuite.scala:
##########
@@ -106,7 +106,7 @@ class ClientSuite extends SparkFunSuite
     val conf = new Configuration()
     val sparkConf = new SparkConf()
       .set(SPARK_JARS, Seq(SPARK))
-      .set(USER_CLASS_PATH_FIRST, true)
+      .set(DRIVER_USER_CLASS_PATH_FIRST, true)

Review Comment:
   Please make a new test case for `DRIVER_USER_CLASS_PATH_FIRST`.



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


Re: [PR] [SPARK-45717][YARN] Avoid use `spark.yarn.user.classpath.first` [spark]

Posted by "cxzl25 (via GitHub)" <gi...@apache.org>.
cxzl25 commented on PR #43579:
URL: https://github.com/apache/spark/pull/43579#issuecomment-2112662447

   I thought about it, and `spark.yarn.user.classpath.first` doesn't quite have the same effect as `spark.driver.userClassPathFirst` or `spark.executor.userClassPathFirst`.
   
   `spark.yarn.user.classpath.first` is similar to `mapreduce.job.user.classpath.first`, declaring that the user's jar is placed at the front of the classpath, so that the YARN startup container will load it first, and it is the same classloader as the jars of spark.
   
   And `spark.{driver,executor}.userClassPathFirst` does not modify the classpath, but uses `ChildFirstURLClassLoader` to load the jar, which is not the same classloader as the spark jars, and the behavior of the two is different.
   
   So the modification of this PR may be invalid. Not sure why this parameter is deprecated.
   
   https://github.com/apache/spark/blob/d0385c4a99c172fa3e1ba2d72a65c8632b5c72a9/core/src/main/scala/org/apache/spark/SparkConf.scala#L605-L606
   
   https://github.com/apache/spark/blob/d0385c4a99c172fa3e1ba2d72a65c8632b5c72a9/resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala#L1527-L1537


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


Re: [PR] [SPARK-45717][YARN] Avoid use `spark.yarn.user.classpath.first` [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #43579:
URL: https://github.com/apache/spark/pull/43579#discussion_r1596992913


##########
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala:
##########
@@ -1490,7 +1490,7 @@ private[spark] object Client extends Logging {
    * Populate the classpath entry in the given environment map.
    *
    * User jars are generally not added to the JVM's system classpath; those are handled by the AM
-   * and executor backend. When the deprecated `spark.yarn.user.classpath.first` is used, user jars
+   * and executor backend. When the `spark.driver.userClassPathFirst` is used, user jars

Review Comment:
   New comment is correct? It seems that we miss `spark.executor.userClassPathFirst` case.



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


Re: [PR] [SPARK-45717][YARN] Avoid use `spark.yarn.user.classpath.first` [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #43579:
URL: https://github.com/apache/spark/pull/43579#discussion_r1596991319


##########
resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/ClientSuite.scala:
##########
@@ -106,7 +106,7 @@ class ClientSuite extends SparkFunSuite
     val conf = new Configuration()
     val sparkConf = new SparkConf()
       .set(SPARK_JARS, Seq(SPARK))
-      .set(USER_CLASS_PATH_FIRST, true)
+      .set(DRIVER_USER_CLASS_PATH_FIRST, true)

Review Comment:
   To @cxzl25, FYI, usually, Apache Spark is reluctant to change a test coverage because the deprecated one is still used in the production.



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


Re: [PR] [SPARK-45717][YARN] Avoid use `spark.yarn.user.classpath.first` [spark]

Posted by "mridulm (via GitHub)" <gi...@apache.org>.
mridulm commented on PR #43579:
URL: https://github.com/apache/spark/pull/43579#issuecomment-2106847791

   Your review covers what I would have added @dongjoon-hyun  :-)


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


Re: [PR] [SPARK-45717][YARN] Avoid use `spark.yarn.user.classpath.first` [spark]

Posted by "cxzl25 (via GitHub)" <gi...@apache.org>.
cxzl25 closed pull request #43579: [SPARK-45717][YARN] Avoid use `spark.yarn.user.classpath.first`
URL: https://github.com/apache/spark/pull/43579


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