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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]