You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/10/31 20:59:09 UTC

[GitHub] [spark] jiangxb1987 commented on a change in pull request #26348: [SPARK-29698][WEB-UI] Enable show total shuffle read size even when task failed

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org