Skip to content

Commit 3b8ae23

Browse files
shahidki31srowen
authored andcommitted
[SPARK-26196][SPARK-26281][WEBUI] Total tasks title in the stage page is incorrect when there are failed or killed tasks and update duration metrics
## What changes were proposed in this pull request? This PR fixes 3 issues 1) Total tasks message in the tasks table is incorrect, when there are failed or killed tasks 2) Sorting of the "Duration" column is not correct 3) Duration in the aggregated tasks summary table and the tasks table and not matching. Total tasks = numCompleteTasks + numActiveTasks + numKilledTasks + numFailedTasks; Corrected the duration metrics in the tasks table as executorRunTime based on the PR #23081 ## How was this patch tested? test step: 1) ``` bin/spark-shell scala > sc.parallelize(1 to 100, 10).map{ x => throw new RuntimeException("Bad executor")}.collect() ``` ![screenshot from 2018-11-28 07-26-00](https://user-images.githubusercontent.com/23054875/49123523-e2691880-f2de-11e8-9c16-60d1865e6e77.png) After patch: ![screenshot from 2018-11-28 07-24-31](https://user-images.githubusercontent.com/23054875/49123525-e432dc00-f2de-11e8-89ca-4a53e19c9c18.png) 2) Duration metrics: Before patch: ![screenshot from 2018-12-06 03-25-14](https://user-images.githubusercontent.com/23054875/49546591-9e8d9900-f906-11e8-8a0b-157742c47655.png) After patch: ![screenshot from 2018-12-06 03-23-14](https://user-images.githubusercontent.com/23054875/49546589-9cc3d580-f906-11e8-827f-52ef8ffdeaec.png) Closes #23160 from shahidki31/totalTasks. Authored-by: Shahid <[email protected]> Signed-off-by: Sean Owen <[email protected]>
1 parent bd00f10 commit 3b8ae23

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

core/src/main/resources/org/apache/spark/ui/static/stagepage.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,8 @@ $(document).ready(function () {
616616
$("#accumulator-table").DataTable(accumulatorConf);
617617

618618
// building tasks table that uses server side functionality
619-
var totalTasksToShow = responseBody.numCompleteTasks + responseBody.numActiveTasks;
619+
var totalTasksToShow = responseBody.numCompleteTasks + responseBody.numActiveTasks +
620+
responseBody.numKilledTasks + responseBody.numFailedTasks;
620621
var taskTable = "#active-tasks-table";
621622
var taskConf = {
622623
"serverSide": true,
@@ -667,8 +668,8 @@ $(document).ready(function () {
667668
{data : "launchTime", name: "Launch Time", render: formatDate},
668669
{
669670
data : function (row, type) {
670-
if (row.duration) {
671-
return type === 'display' ? formatDuration(row.duration) : row.duration;
671+
if (row.taskMetrics && row.taskMetrics.executorRunTime) {
672+
return type === 'display' ? formatDuration(row.taskMetrics.executorRunTime) : row.taskMetrics.executorRunTime;
672673
} else {
673674
return "";
674675
}
@@ -927,7 +928,7 @@ $(document).ready(function () {
927928

928929
// title number and toggle list
929930
$("#summaryMetricsTitle").html("Summary Metrics for " + "<a href='#tasksTitle'>" + responseBody.numCompleteTasks + " Completed Tasks" + "</a>");
930-
$("#tasksTitle").html("Task (" + totalTasksToShow + ")");
931+
$("#tasksTitle").html("Tasks (" + totalTasksToShow + ")");
931932

932933
// hide or show the accumulate update table
933934
if (accumulatorTable.length == 0) {

core/src/main/scala/org/apache/spark/status/api/v1/StagesResource.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ private[v1] class StagesResource extends BaseAppResource {
210210
(containsValue(f.taskId) || containsValue(f.index) || containsValue(f.attempt)
211211
|| containsValue(f.launchTime)
212212
|| containsValue(f.resultFetchStart.getOrElse(defaultOptionString))
213-
|| containsValue(f.duration.getOrElse(defaultOptionString))
214213
|| containsValue(f.executorId) || containsValue(f.host) || containsValue(f.status)
215214
|| containsValue(f.taskLocality) || containsValue(f.speculative)
216215
|| containsValue(f.errorMessage.getOrElse(defaultOptionString))

0 commit comments

Comments
 (0)