Skip to content

Commit 2c86a9e

Browse files
committed
Use tryFailure to support calling jobFailed multiple times
1 parent ca6fe35 commit 2c86a9e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/main/scala/org/apache/spark/scheduler/JobWaiter.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ private[spark] class JobWaiter[T](
6262
if (finishedTasks == totalTasks) {
6363
_jobFinished = true
6464
jobResult = JobSucceeded
65-
promise.success()
65+
promise.trySuccess()
6666
this.notifyAll()
6767
}
6868
}
6969

7070
override def jobFailed(exception: Exception): Unit = synchronized {
7171
_jobFinished = true
7272
jobResult = JobFailed(exception)
73-
promise.failure(exception)
73+
promise.tryFailure(exception)
7474
this.notifyAll()
7575
}
7676

0 commit comments

Comments
 (0)