juliuszsompolski commented on a change in pull request #25946: [SPARK-29263] 
availableSlots in resourceOffers can change before being checked by barrier 
TaskSet
URL: https://github.com/apache/spark/pull/25946#discussion_r328786648
 
 

 ##########
 File path: 
core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala
 ##########
 @@ -444,6 +443,7 @@ private[spark] class TaskSchedulerImpl(
     // of locality levels so that it gets a chance to launch local tasks on 
all of them.
     // NOTE: the preferredLocality order: PROCESS_LOCAL, NODE_LOCAL, NO_PREF, 
RACK_LOCAL, ANY
     for (taskSet <- sortedTaskSets) {
+      val availableSlots = availableCpus.map(c => c / CPUS_PER_TASK).sum
 
 Review comment:
   to avoid reiterating over the availableCpus array, we could also have one 
var that gets passed and updated inside resourceOfferSingleTaskSet, but that 
would likely be an overoptimization of this O(#num_offers) sum.

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


With regards,
Apache Git Services

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

Reply via email to