spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shashank Mandil <mandil.shash...@gmail.com>
Subject Spark submit on yarn does not return with exit code 1 on exception
Date Fri, 03 Feb 2017 19:06:58 GMT
Hi All,

I wrote a test script which always throws an exception as below :

object Test {


  def main(args: Array[String]) {
    try {

      val conf =
        new SparkConf()
          .setAppName("Test")

      throw new RuntimeException("Some Exception")

      println("all done!")
    } catch {
      case e: RuntimeException => {
        println("There is an exception in the script exiting with status 1")
        System.exit(1)
      }
    }
}

When I run this code using spark-submit I am expecting to get an exit code
of 1,
however I keep getting exit code 0.

Any ideas how I can force spark-submit to return with code 1 ?

Thanks,
Shashank

Mime
View raw message