Ngone51 commented on code in PR #37268:
URL: https://github.com/apache/spark/pull/37268#discussion_r928575962


##########
core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala:
##########
@@ -388,14 +388,19 @@ private[spark] class TaskSchedulerImpl(
       val execId = shuffledOffers(i).executorId
       val host = shuffledOffers(i).host
       val taskSetRpID = taskSet.taskSet.resourceProfileId
+      val prof = sc.resourceProfileManager.resourceProfileFromId(taskSetRpID)
+      val targetExecutorRpID = if (prof.isForTaskOnly) {
+        ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID
+      } else {
+        taskSetRpID

Review Comment:
   This seems to be error-prone. If people are not aware of `isForTaskOnly`, 
they might use the wrong `taskSetRpID`.
   
   How about we assign `ResourceProfile._id` to `DEFAULT_RESOURCE_PROFILE_ID ` 
if `isForTaskOnly=true`? 



-- 
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: [email protected]

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