Hey, so it looks like this actually breaks the Mesos mode, because Mesos just launches the spark-executor script directly, and there's no ExecutorRunner involved. However, simply passing SPARK_MEM as in this loop probably isn't right because you added the system property. Instead, just do `executorEnvs("SPARK_MEM") = executorMemory`.

We should also eventually tell users *not* to set SPARK_MEM in their conf/spark-env.sh. I'll think about whether there's a way to automatically complain if it's set there but it's not super easy because you need to use it sometimes, e.g. when you launch the shell. Maybe the best thing to do is to add a second variable, SPARK_MEMORY, that overrides the value of SPARK_MEM if set; and make this Mesos env code and the ExecutorRunner set that one instead.