title: How to limit the number of retries on Spark job failure?
body: <p>We are running a Spark job via <code>spark-submit</code>, and I can see that the job will be re-submitted in the case of failure.</p>
  
  <p>How can I stop it from having attempt #2 in case of yarn container failure or whatever the exception be?</p>
  
  <p><a href="https://i.stack.imgur.com/lqdyg.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lqdyg.png" alt="enter image description here"></a></p>
  
  <p>This happened due to lack of memory and "GC overhead limit exceeded" issue.</p>