Skip to content

Commit adb33d3

Browse files
zsxwingsarutak
authored andcommitted
[SPARK-9012] [WEBUI] Escape Accumulators in the task table
If running the following codes, the task table will be broken because accumulators aren't escaped. ``` val a = sc.accumulator(1, "<table>") sc.parallelize(1 to 10).foreach(i => a += i) ``` Before this fix, <img width="1348" alt="screen shot 2015-07-13 at 8 02 44 pm" src="https://cloud.githubusercontent.com/assets/1000778/8649295/b17c491e-299b-11e5-97ee-4e6a64074c4f.png"> After this fix, <img width="1355" alt="screen shot 2015-07-13 at 8 14 32 pm" src="https://cloud.githubusercontent.com/assets/1000778/8649337/f9e9c9ec-299b-11e5-927e-35c0a2f897f5.png"> Author: zsxwing <[email protected]> Closes apache#7369 from zsxwing/SPARK-9012 and squashes the following commits: a83c9b6 [zsxwing] Escape Accumulators in the task table
1 parent 14935d8 commit adb33d3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,9 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") {
692692
val gettingResultTime = getGettingResultTime(info, currentTime)
693693

694694
val maybeAccumulators = info.accumulables
695-
val accumulatorsReadable = maybeAccumulators.map{acc => s"${acc.name}: ${acc.update.get}"}
695+
val accumulatorsReadable = maybeAccumulators.map { acc =>
696+
StringEscapeUtils.escapeHtml4(s"${acc.name}: ${acc.update.get}")
697+
}
696698

697699
val maybeInput = metrics.flatMap(_.inputMetrics)
698700
val inputSortable = maybeInput.map(_.bytesRead.toString).getOrElse("")

0 commit comments

Comments
 (0)