You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/04/17 22:44:02 UTC

[GitHub] [spark] wbo4958 commented on a diff in pull request #36208: [SPARK-38911][CORE] Fix the potential resource profile id mess up issue

wbo4958 commented on code in PR #36208:
URL: https://github.com/apache/spark/pull/36208#discussion_r851812162


##########
core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala:
##########
@@ -3256,11 +3256,12 @@ class DAGSchedulerSuite extends SparkFunSuite with TempLocalSparkContext with Ti
   }
 
   test("test 1 resource profile") {
+    val sparkContext = sc

Review Comment:
   @LuciferYang Yep, the id 1 will not exist in this case. IMO, the rp id is just an identifier, and the value itself does not have any meaning. So I'm thinking it's okay. And for below scenario,
   
   ``` scala
       val sc = new SparkContext("local[12]", "rp")
       sc.stop()
       val sc1 = new SparkContext( "local[12]","rp")
       val ereqs = new ExecutorResourceRequests().cores(4)
       val treqs = new TaskResourceRequests().cpus(1)
       val rp1 = new ResourceProfileBuilder().require(ereqs).require(treqs).build
       println(s"rp1.id = ${rp1.id}")
       sc1.stop()
   ```
   
   we will get rp1.id=1
   
   the profile with id 1 will also no longer exist.



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