pan3793 commented on code in PR #57716:
URL: https://github.com/apache/spark/pull/57716#discussion_r3727979472
##########
core/src/main/scala/org/apache/spark/memory/UnifiedMemoryManager.scala:
##########
@@ -459,12 +466,14 @@ object UnifiedMemoryManager extends Logging {
/**
* Return the total amount of memory shared between execution and storage,
in bytes.
*/
- private def getMaxMemory(conf: SparkConf): Long = {
+ private def getMaxMemory(conf: SparkConf, isDriver: Option[Boolean]): Long =
{
val systemMemory = conf.get(TEST_MEMORY)
val reservedMemory = conf.getLong(TEST_RESERVED_MEMORY.key,
if (conf.contains(IS_TESTING)) 0 else RESERVED_SYSTEM_MEMORY_BYTES)
val minSystemMemory = (reservedMemory * 1.5).ceil.toLong
- if (systemMemory < minSystemMemory) {
+ val checkDriverMemory = isDriver.isEmpty || isDriver.contains(true)
+ val checkExecutorMemory = isDriver.isEmpty || isDriver.contains(false)
Review Comment:
This reverts the SPARK-12759 fail-fast: the driver no longer validates
`spark.executor.memory` at `SparkContext` startup, so an undersized value now
launches executors that all fail until the cluster manager gives up. The
executor-memory check is cheap and correct on both roles; only the
`INVALID_DRIVER_MEMORY` check needs gating:
```scala
if (isDriver.getOrElse(true) && systemMemory < minSystemMemory) { ... }
// SPARK-12759: keep unconditional
if (conf.contains(config.EXECUTOR_MEMORY)) { ... }
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]