title: Can YARN preempt Spark Driver?
body: <p>Can anyone clarify can or can't YARN preempt Spark Driver because application eat more resources than allowed by it's queue?</p>
  
  <p>This question arised from scenario on prod cluster:</p>
  
  <ol>
  <li>CDH 5.12, hadoop 2.6.0, fair scheduller is used</li>
  <li>Queue A = 50%, Queue B = 25%, Queue C = 25%</li>
  <li>two apps, say app1 and app2 run in queue B, and has eaten all cluster resources.</li>
  <li>after a while app3 starts in queue A and claims its resources</li>
  <li>app1 and app2 kill some of their executors (at least I see <code>ERROR | SIGTERM handler | org.apache.spark.executor.CoarseGrainedExecutorBackend | RECEIVED SIGNAL TERM</code>)</li>
  <li>app1 prints error message about ApplicationMaster death:
  <code>ERROR | SIGTERM handler | org.apache.spark.deploy.yarn.ApplicationMaster | RECEIVED SIGNAL TERM</code>. NM logs just say that driver container was killed: <code>Stopping container with container Id: app1_driver_containerId</code>. </li>
  </ol>
  
  <p>I cant find any evidences in documentation that RM can kill application master. Docs say that it asks master politely to free resources, and I they are not freed then it forcely kill containers. Can it kill AM?</p>