I think there is a timeout set after which if the task does not stop running, then the executor will self-destruct. Try disabling it as follows:
val sc = new SparkContext(new SparkConf())
./bin/spark-submit <all your existing options> --spark.task.reaper.killTimeout=-1