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

    https://github.com/apache/spark/pull/9027#discussion_r47868921
  
    --- Diff: 
core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackend.scala
 ---
    @@ -239,44 +250,69 @@ private[spark] class MesosSchedulerBackend(
               
.setRefuseSeconds(rejectOfferDurationForUnmetConstraints).build())
           }
     
    -      // Of the matching constraints, see which ones give us enough memory 
and cores
    -      val (usableOffers, unUsableOffers) = 
offersMatchingConstraints.partition { o =>
    -        val mem = getResource(o.getResourcesList, "mem")
    -        val cpus = getResource(o.getResourcesList, "cpus")
    -        val slaveId = o.getSlaveId.getValue
    -        val offerAttributes = toAttributeMap(o.getAttributesList)
    -
    -        // check offers for
    -        //  1. Memory requirements
    -        //  2. CPU requirements - need at least 1 for executor, 1 for task
    -        val meetsMemoryRequirements = mem >= calculateTotalMemory(sc)
    -        val meetsCPURequirements = cpus >= (mesosExecutorCores + 
scheduler.CPUS_PER_TASK)
    -        val meetsRequirements =
    -          (meetsMemoryRequirements && meetsCPURequirements) ||
    +    // Of the matching constraints, see which ones give us enough memory 
and cores
    +    val (usableOffers, unUsableOffers) = 
offersMatchingConstraints.partition { o =>
    +      val mem = getResource(o.getResourcesList, "mem")
    +      val cpus = getResource(o.getResourcesList, "cpus")
    +      val slaveId = o.getSlaveId.getValue
    +      val offerAttributes = toAttributeMap(o.getAttributesList)
    +
    +      // check offers for
    +      //  1. Memory requirements
    +      //  2. CPU requirements - need at least 1 for executor, 1 for task
    +      val meetsMemoryRequirements = mem >= calculateTotalMemory(sc)
    +      val meetsCPURequirements = cpus >= (mesosExecutorCores + 
scheduler.CPUS_PER_TASK)
    --- End diff --
    
    I think technically this is not correct (which exists in code before, not 
your change). We can still launch new tasks if there is already an executor 
running without mesosExecutoreCores. Probably fix this in the future.


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