You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "jerrypeng (via GitHub)" <gi...@apache.org> on 2026/07/22 18:43:55 UTC
Re: [PR] [WIP] [SPARK-XXXXX][CORE] Concurrently schedule pipelined-shuffle stage groups in the DAGScheduler [spark]
jerrypeng commented on code in PR #57341:
URL: https://github.com/apache/spark/pull/57341#discussion_r3632888982
##########
core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala:
##########
@@ -2417,43 +2808,83 @@ private[spark] class DAGScheduler(
// are properly notified and can chose to handle it. For instance, some listeners are
// doing their own accounting and if they don't get the task end event they think
// tasks are still running when they really aren't.
- postTaskEnd(event)
+ //
+ // Exception: a replayed pipelined-consumer completion (finishOnly) already fired its TaskEnd
+ // inline when the task first completed; only the deferred stage/job bookkeeping was
+ // re-posted. If the stage was torn down (e.g. a sibling aborted the group) before this replay
+ // dequeues, re-posting TaskEnd here would double-count it in listeners. Skip for finishOnly.
+ if (!event.finishOnly) {
+ postTaskEnd(event)
+ }
// Skip all the actions if the stage has been cancelled.
return
}
val stage = stageIdToStage(task.stageId)
- // Make sure the task's accumulators are updated before any other processing happens, so that
- // we can post a task end event before any jobs or stages are updated. The accumulators are
- // only updated in certain cases.
- event.reason match {
- case Success =>
- task match {
- case rt: ResultTask[_, _] =>
- val resultStage = stage.asInstanceOf[ResultStage]
- resultStage.activeJob match {
- case Some(job) =>
- // Only update the accumulator once for each result task.
- if (!job.finished(rt.outputId)) {
- updateAccumulators(event)
- }
- case None => // Ignore update if task's job has finished.
- }
- case _ =>
- updateAccumulators(event)
- }
- case _: ExceptionFailure | _: TaskKilled => updateAccumulators(event)
- case _ =>
- }
- if (trackingCacheVisibility) {
- // Update rdd blocks' visibility status.
- blockManagerMaster.updateRDDBlockVisibility(
- event.taskInfo.taskId, visible = event.reason == Success)
+ // Group-observable completion for a pipelined consumer: its per-task side effects (accumulator
Review Comment:
This logic here can be greatly simplified if we do eagerly emit task completion events and delay stage / job completion events.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org