The technical term for what you want to do is Speculation. Speculation is when you relaunch the task if it is running slow. To do this, you can use the below command:
val sc = new SparkContext(new SparkConf())
./bin/spark-submit <all your existing options> --spark.speculation=true