Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 13 additions & 17 deletions core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,16 @@ private[spark] class DAGScheduler(
private val messageScheduler =
ThreadUtils.newDaemonSingleThreadScheduledExecutor("dag-scheduler-message")

private def scheduleResubmit(): Unit = {
messageScheduler.schedule(
new Runnable {
override def run(): Unit = eventProcessLoop.post(ResubmitFailedStages)
},
DAGScheduler.RESUBMIT_TIMEOUT,
TimeUnit.MILLISECONDS
)
}

private[spark] var eventProcessLoop = new DAGSchedulerEventProcessLoop(this)
// Used for test only. Some tests uses the same thread of the event poster to
// process the events to ensure the deterministic behavior during the test.
Expand Down Expand Up @@ -2179,13 +2189,7 @@ private[spark] class DAGScheduler(
if (noResubmitEnqueued) {
logInfo(log"Resubmitting ${MDC(FAILED_STAGE, stage)} " +
log"(${MDC(FAILED_STAGE_NAME, stage.name)}) due to rollback.")
messageScheduler.schedule(
new Runnable {
override def run(): Unit = eventProcessLoop.post(ResubmitFailedStages)
},
DAGScheduler.RESUBMIT_TIMEOUT,
TimeUnit.MILLISECONDS
)
scheduleResubmit()
}
}

Expand Down Expand Up @@ -2510,13 +2514,7 @@ private[spark] class DAGScheduler(
log"Resubmitting ${MDC(STAGE, mapStage)} " +
log"(${MDC(STAGE_NAME, mapStage.name)}) and ${MDC(FAILED_STAGE, failedStage)} " +
log"(${MDC(FAILED_STAGE_NAME, failedStage.name)}) due to fetch failure")
messageScheduler.schedule(
new Runnable {
override def run(): Unit = eventProcessLoop.post(ResubmitFailedStages)
},
DAGScheduler.RESUBMIT_TIMEOUT,
TimeUnit.MILLISECONDS
)
scheduleResubmit()
}
}

Expand Down Expand Up @@ -2623,9 +2621,7 @@ private[spark] class DAGScheduler(
if (noResubmitEnqueued) {
logInfo(log"Resubmitting ${MDC(FAILED_STAGE, failedStage)} " +
log"(${MDC(FAILED_STAGE_NAME, failedStage.name)}) due to barrier stage failure.")
messageScheduler.schedule(new Runnable {
override def run(): Unit = eventProcessLoop.post(ResubmitFailedStages)
}, DAGScheduler.RESUBMIT_TIMEOUT, TimeUnit.MILLISECONDS)
scheduleResubmit()
}
}
}
Expand Down