Skip to content

Commit

Permalink
Make jobFailed idempotent
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshRosen committed Jul 17, 2015
1 parent 7b22514 commit 1a19268
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ private[spark] class JobWaiter[T](
}

override def jobFailed(exception: Exception): Unit = synchronized {
promise.failure(exception)
// There are certain situations where jobFailed can be called multiple times for the same
// job. We guard against this by making this method idempotent.
if (!isCompleted) {
promise.failure(exception)
} else {
assert(promiseFuture.value.get.isFailure)
}
}
}

0 comments on commit 1a19268

Please sign in to comment.