pushpavanthar opened a new pull request, #60252: URL: https://github.com/apache/spark/pull/60252
### What changes were proposed in this pull request? Extract the block that `CoarseGrainedExecutorBackend.run` uses to apply a non-default `ResourceProfile`'s executor memory and cores to the executor's `SparkConf` (added in SPARK-50421) into a shared helper, `CoarseGrainedExecutorBackend.setResourceProfileConfs`, and call it from `KubernetesExecutorBackend.run` as well. `KubernetesExecutorBackend.run` duplicates the generic executor startup sequence (it needs to resolve the executor id from the pod name) and was not updated when SPARK-50421 landed. ### Why are the changes needed? On Kubernetes, an executor launched for a non-default `ResourceProfile` currently keeps the application-level `spark.executor.memory`, `spark.executor.memoryOverhead`, `spark.memory.offHeap.size` and `spark.executor.cores` in its `SparkConf`. Executor-side readers of those confs therefore size things from the wrong profile: - `MemoryManager` sizes the off-heap execution and storage pools from `spark.memory.offHeap.size`. - `PythonRunner` falls back to `spark.executor.cores` when the stage does not carry `EXECUTOR_CORES_LOCAL_PROPERTY`, which decides how `spark.executor.pyspark.memory` is split across concurrent Python workers. YARN and Standalone executors already see the profile's values through `CoarseGrainedExecutorBackend.run`; this PR brings Kubernetes to parity. ### Does this PR introduce _any_ user-facing change? Yes, a bug fix on Kubernetes only. Executors started for a non-default `ResourceProfile` now see that profile's memory and cores values in `SparkEnv.conf`, matching YARN and Standalone since Spark 4.0. Default-profile executors are unchanged. ### How was this patch tested? New unit tests in `CoarseGrainedExecutorBackendSuite` for the shared helper: a non-default profile sets the four confs; the default profile leaves them untouched. `kubernetes` module compiled against the change. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Fable 5.1), reviewed and verified by the author. -- 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]
