Skip to content

Commit

Permalink
[SPARK-4787] Ensure that call to stop() doesn't lose the exception by…
Browse files Browse the repository at this point in the history
… using a finally block.
  • Loading branch information
tigerquoll committed Dec 30, 2014
1 parent 2172578 commit 5661e01
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions core/src/main/scala/org/apache/spark/SparkContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,11 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli
dagScheduler = new DAGScheduler(this)
} catch {
case e: Exception => {
stop()
throw
new SparkException("DAGScheduler cannot be initialized due to %s".format(e.getMessage))
try {
stop()
} finally {
throw new SparkException("Error while constructing DAGScheduler", e)
}
}
}

Expand Down

0 comments on commit 5661e01

Please sign in to comment.