Repository: spark
Updated Branches:
  refs/heads/master 836a75898 -> 8f2082426


[SPARK-7864] [UI] Do not kill innocent stages from visualization

**Reproduction.** Run a long-running job, go to the job page, expand the DAG 
visualization, and click into a stage. Your stage is now killed. Why? This is 
because the visualization code just reaches into the stage table and grabs the 
first link it finds. In our case, this first link happens to be the kill link 
instead of the one to the stage page.

**Fix.** Use proper CSS selectors to avoid ambiguity.

This is an alternative to #6407. Thanks carsonwang for catching this.

Author: Andrew Or <[email protected]>

Closes #6419 from andrewor14/fix-ui-viz-kill and squashes the following commits:

25203bd [Andrew Or] Do not kill innocent stages


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/8f208242
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/8f208242
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/8f208242

Branch: refs/heads/master
Commit: 8f2082426828c15704426ebca1d015bf956c6841
Parents: 836a758
Author: Andrew Or <[email protected]>
Authored: Tue May 26 16:31:34 2015 -0700
Committer: Andrew Or <[email protected]>
Committed: Tue May 26 16:31:34 2015 -0700

----------------------------------------------------------------------
 .../src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js | 2 +-
 .../src/main/resources/org/apache/spark/ui/static/timeline-view.js | 2 +-
 core/src/main/scala/org/apache/spark/ui/jobs/StageTable.scala      | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/8f208242/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js
----------------------------------------------------------------------
diff --git 
a/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js 
b/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js
index aaeba5b..e96af87 100644
--- a/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js
+++ b/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js
@@ -193,7 +193,7 @@ function renderDagVizForJob(svgContainer) {
       // Use the link from the stage table so it also works for the history 
server
       var attemptId = 0
       var stageLink = d3.select("#stage-" + stageId + "-" + attemptId)
-        .select("a")
+        .select("a.name-link")
         .attr("href") + "&expandDagViz=true";
       container = svgContainer
         .append("a")

http://git-wip-us.apache.org/repos/asf/spark/blob/8f208242/core/src/main/resources/org/apache/spark/ui/static/timeline-view.js
----------------------------------------------------------------------
diff --git 
a/core/src/main/resources/org/apache/spark/ui/static/timeline-view.js 
b/core/src/main/resources/org/apache/spark/ui/static/timeline-view.js
index 604c299..28ac998 100644
--- a/core/src/main/resources/org/apache/spark/ui/static/timeline-view.js
+++ b/core/src/main/resources/org/apache/spark/ui/static/timeline-view.js
@@ -105,7 +105,7 @@ function drawJobTimeline(groupArray, eventObjArray, 
startTime) {
       };
 
       $(this).click(function() {
-        var stagePagePath = 
$(getSelectorForStageEntry(this)).find("a").attr("href")
+        var stagePagePath = 
$(getSelectorForStageEntry(this)).find("a.name-link").attr("href")
         window.location.href = stagePagePath
       });
 

http://git-wip-us.apache.org/repos/asf/spark/blob/8f208242/core/src/main/scala/org/apache/spark/ui/jobs/StageTable.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/ui/jobs/StageTable.scala 
b/core/src/main/scala/org/apache/spark/ui/jobs/StageTable.scala
index 82ba561..99812db 100644
--- a/core/src/main/scala/org/apache/spark/ui/jobs/StageTable.scala
+++ b/core/src/main/scala/org/apache/spark/ui/jobs/StageTable.scala
@@ -93,7 +93,7 @@ private[ui] class StageTableBase(
     }
 
     val nameLinkUri = 
s"$basePathUri/stages/stage?id=${s.stageId}&attempt=${s.attemptId}"
-    val nameLink = <a href={nameLinkUri}>{s.name}</a>
+    val nameLink = <a href={nameLinkUri} class="name-link">{s.name}</a>
 
     val cachedRddInfos = s.rddInfos.filter(_.numCachedPartitions > 0)
     val details = if (s.details.nonEmpty) {


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

Reply via email to