jiangxb1987 commented on a change in pull request #26348: [SPARK-29698][WEB-UI] 
Enable show total shuffle read size even when task failed
URL: https://github.com/apache/spark/pull/26348#discussion_r341362966
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala
 ##########
 @@ -1399,8 +1399,20 @@ private[spark] class DAGScheduler(
           case _ =>
             updateAccumulators(event)
         }
-      case _: ExceptionFailure | _: TaskKilled => updateAccumulators(event)
-      case _ =>
+
+      case fail =>
+        if (task.metrics.shuffleReadMetrics.recordsRead == 0) {
+          val reduceId = task.partitionId
+          val shuffleReadSize = 
stage.parents.filter(_.isInstanceOf[ShuffleMapStage])
+            .map(_.asInstanceOf[ShuffleMapStage].shuffleDep.shuffleId)
+            
.map(mapOutputTracker.shuffleStatuses.get(_)).map(_.get.mapStatuses)
+            .flatMap(_.map(_.getSizeForBlock(reduceId))).sum
+          task.metrics.shuffleReadMetrics.setRecordsRead(shuffleReadSize)
 
 Review comment:
   This is not the total records that have been read, why set it to the metrics?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to