spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dragos <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-12832][CORE] Fix dispatcher does not ha...
Date Fri, 15 Jan 2016 15:04:22 GMT
Github user dragos commented on a diff in the pull request:

    https://github.com/apache/spark/pull/10768#discussion_r49862201
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosClusterScheduler.scala
---
    @@ -519,6 +521,20 @@ private[spark] class MesosClusterScheduler(
         val currentTime = new Date()
     
         stateLock.synchronized {
    +      var it = offers.iterator()
    +      while (it.hasNext) {
    +        val offer = it.next()
    +        val offerAttributes = toAttributeMap(offer.getAttributesList)
    +        val meetsConstraints = matchesAttributeRequirements(driverOfferConstraints, offerAttributes)
    +
    +        if (!meetsConstraints) {
    +          driver.declineOffer(offer.getId)
    +          it.remove()
    --- End diff --
    
    I'd rather not mutate the underlying collection. Anyhow, this has no effect because the
code below is using `currentOffers`, which is a copy of the original resources made earlier.
I suggest you insert this filter at that point.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message