Skip to content

Commit

Permalink
[SPARK-4787] Stop context properly if an exception occurs during DAGS…
Browse files Browse the repository at this point in the history
…cheduler initialization.
  • Loading branch information
tigerquoll committed Dec 26, 2014
1 parent 29fabb1 commit 2172578
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/src/main/scala/org/apache/spark/SparkContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,11 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli
try {
dagScheduler = new DAGScheduler(this)
} catch {
case e: Exception => throw
new SparkException("DAGScheduler cannot be initialized due to %s".format(e.getMessage))
case e: Exception => {
stop()
throw
new SparkException("DAGScheduler cannot be initialized due to %s".format(e.getMessage))
}
}

// start TaskScheduler after taskScheduler sets DAGScheduler reference in DAGScheduler's
Expand Down

0 comments on commit 2172578

Please sign in to comment.