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

    https://github.com/apache/spark/pull/1140#discussion_r14163153
  
    --- Diff: 
core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackend.scala
 ---
    @@ -206,14 +203,13 @@ private[spark] class MesosSchedulerBackend(
             val taskLists = scheduler.resourceOffers(offerableWorkers)
     
             // Build a list of Mesos tasks for each slave
    -        val mesosTasks = offers.map(o => 
Collections.emptyList[MesosTaskInfo]())
    +        val mesosTasks = offers.map(o => new JArrayList[MesosTaskInfo]())
             for ((taskList, index) <- taskLists.zipWithIndex) {
               if (!taskList.isEmpty) {
    -            val offerNum = offerableIndices(index)
    -            val slaveId = offers(offerNum).getSlaveId.getValue
    -            slaveIdsWithExecutors += slaveId
    -            mesosTasks(offerNum) = new 
JArrayList[MesosTaskInfo](taskList.size)
                 for (taskDesc <- taskList) {
    +              val slaveId = taskDesc.executorId
    +              val offerNum = offers.indexWhere(_.getSlaveId.getValue == 
slaveId)
    --- End diff --
    
    Is it not possible to get more than one mesos offer on the same slave? This 
seems to make the assumption that that will never happen. Also, this currently 
will linearly scan the list of offers for every offer we accept. I think that's 
something we'd like to avoid.


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

Reply via email to