title: Can not change number of cores for spark executors after first run
body: <p>I use spark 2.1.0 and I noticed strange behavior in my spark streaming application. I can not change number of cores for executor once they were set up during first run. Application is run on spark standalone cluster.</p>
  
  <p>First time I run my spark streaming app in this way</p>
  
  <pre><code>spark-submit --driver-java-options -Denv=test --master spark://my_server:6066 --deploy-mode cluster --driver-memory 3G  --driver-cores 4  --executor-memory 3G --executor-cores 4 --conf spark.metrics.conf=/usr/lib/spark/conf/metrics_analytics.properties --class com.MyApp hdfs:///apps/app.jar
  </code></pre>
  
  <p>Than I stopped my app </p>
  
  <pre><code>spark-submit --master spark://my_server:6066 --kill driver-20170807163818-0051 
  </code></pre>
  
  <p>and I run my spark (3 core per executor)</p>
  
  <pre><code>spark-submit --driver-java-options -Denv=test --master spark://my_server:6066 --deploy-mode cluster --driver-memory 3G  --driver-cores 4  --executor-memory 3G --executor-cores 3 --conf spark.metrics.conf=/usr/lib/spark/conf/metrics_analytics.properties --class com.MyApp hdfs:///apps/app.jar
  
  {[my_server] out:   "action" : "CreateSubmissionResponse",
  [my_server] out:   "message" : "Driver successfully submitted as driver-20170808093847-0052",
  [my_servero] out:   "serverSparkVersion" : "2.1.0",
  [my_server] out:   "submissionId" : "driver-20170808093847-0052",
  [my_server] out:   "success" : true
  [my_server] out: }
  </code></pre>
  
  <p>here is my spark config</p>
  
  <pre><code>  .setMaster(configuration.spark.master) //it is better to set master as a spark submit param
    .set("spark.cassandra.connection.host", configuration.cassandra.server)
    .set("spark.cassandra.auth.username", configuration.cassandra.user)
    .set("spark.cassandra.auth.password", configuration.cassandra.password)
    .set("spark.cassandra.connection.keep_alive_ms", configuration.cassandra.timeout.toString)
    .set("spark.streaming.backpressure.enabled", "true")
    .set("spark.streaming.kafka.maxRatePerPartition", configuration.spark.maxRatePerPartition.toString)
    .set("spark.streaming.stopGracefullyOnShutdown", "true")
    .set("spark.metrics.namespace", "my-app")
    .set("spark.cassandra.output.consistency.level", "LOCAL_QUORUM")
  </code></pre>
  
  <p>Even when I change number of cores for executor, my application still uses 4 cores  instead of 3.
  I also removed checkpoint data but it hasn't helped.</p>
  
  <p>I'm wondering if it is only UI problem or I can not change configuration for my application because of some reason (some metadata stored for job by app name ?).</p>
  
  <p>Here is my
  <a href="https://i.stack.imgur.com/oxVBQ.png" rel="nofollow noreferrer">Spark UI</a></p>