Github user tnachen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9027#discussion_r47869013
  
    --- Diff: 
core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackend.scala
 ---
    @@ -304,20 +340,25 @@ private[spark] class MesosSchedulerBackend(
                 mesosTasks.getOrElseUpdate(slaveId, new 
JArrayList[MesosTaskInfo])
                   .add(mesosTask)
                 slaveIdToResources(slaveId) = remainingResources
    +
    +            totalCoresAcquired += getResource(mesosTask.getResourcesList, 
"cpus")
               }
             }
     
           // Reply to the offers
           val filters = Filters.newBuilder().setRefuseSeconds(1).build() // 
TODO: lower timeout?
     
    -      mesosTasks.foreach { case (slaveId, tasks) =>
    -        slaveIdToWorkerOffer.get(slaveId).foreach(o =>
    -          
listenerBus.post(SparkListenerExecutorAdded(System.currentTimeMillis(), slaveId,
    -            // TODO: Add support for log urls for Mesos
    -            new ExecutorInfo(o.host, o.cores, Map.empty)))
    -        )
    -        logTrace(s"Launching Mesos tasks on slave '$slaveId', 
tasks:\n${getTasksSummary(tasks)}")
    -        
d.launchTasks(Collections.singleton(slaveIdToOffer(slaveId).getId), tasks, 
filters)
    +      mesosTasks.foreach {
    +        case (slaveId, tasks) =>
    +          // add the cores reserved for each Mesos executor (one per slave)
    +          totalCoresAcquired += 
getResource(tasks.get(0).getExecutor.getResourcesList, "cpus")
    --- End diff --
    
    We should only account for executor resources once per slave, not for every 
task


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to