Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/731#discussion_r27090207
--- Diff: core/src/main/scala/org/apache/spark/deploy/master/Master.scala
---
@@ -513,89 +513,122 @@ private[spark] class Master(
}
/**
- * Can an app use the given worker? True if the worker has enough memory
and we haven't already
- * launched an executor for the app on it (right now the standalone
backend doesn't like having
- * two executors on the same worker).
+ * Can an app use the given worker?
*/
- def canUse(app: ApplicationInfo, worker: WorkerInfo): Boolean = {
- worker.memoryFree >= app.desc.memoryPerSlave &&
!worker.hasExecutor(app)
+ private def canUse(app: ApplicationInfo, worker: WorkerInfo): Boolean = {
+ val enoughResources = worker.memoryFree >=
app.desc.memoryPerExecutorMB && worker.coresFree > 0
+ val allowToExecute = app.desc.maxCorePerExecutor.isDefined ||
!worker.hasExecutor(app)
+ allowToExecute && enoughResources
--- End diff --
I'm not sure if we need `allowToExecute` here. If `maxCorePerExecutor` is
not defined then we will grab all the cores, in which case `worker.coresFree`
will be 0.
---
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]