Github user dragos commented on a diff in the pull request:
https://github.com/apache/spark/pull/8872#discussion_r42725390
--- Diff:
core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosClusterScheduler.scala
---
@@ -497,28 +505,28 @@ private[spark] class MesosClusterScheduler(
container, image, volumes = volumes, portmaps = portmaps)
taskInfo.setContainer(container.build())
}
- val queuedTasks = tasks.getOrElseUpdate(offer.offer.getId, new
ArrayBuffer[TaskInfo])
+ val queuedTasks = tasks.getOrElseUpdate(offer.offerId, new
ArrayBuffer[TaskInfo])
queuedTasks += taskInfo.build()
- logTrace(s"Using offer ${offer.offer.getId.getValue} to launch
driver " +
+ logTrace(s"Using offer ${offer.offerId.getValue} to launch driver
" +
submission.submissionId)
- val newState = new MesosClusterSubmissionState(submission, taskId,
offer.offer.getSlaveId,
+ val newState = new MesosClusterSubmissionState(submission, taskId,
offer.slaveId,
None, new Date(), None)
launchedDrivers(submission.submissionId) = newState
launchedDriversState.persist(submission.submissionId, newState)
afterLaunchCallback(submission.submissionId)
}
}
+ currentOffers
--- End diff --
It seems wrong to return all original offers. Why not filter out the `used`
ones? Callers of this method already do that, so you could get rid of the
`used` field and simply filter out here. It will simplify reasoning everywhere.
---
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]