From 53d65fd12dd9231139188227ef9040d40d759021 Mon Sep 17 00:00:00 2001 From: Cheng Pan Date: Tue, 11 Jun 2024 11:28:50 +0800 Subject: [PATCH] [SPARK-48565][UI] Fix thread dump display in UI ### What changes were proposed in this pull request? Thread dump display in UI is not pretty as before, this is side-effect introduced by SPARK-44863 ### Why are the changes needed? Restore thread dump display in UI. ### Does this PR introduce _any_ user-facing change? Yes, it only affects UI display. ### How was this patch tested? Current master: master-branch With this patch applied: Xnip2024-06-07_20-00-38 ### Was this patch authored or co-authored using generative AI tooling? No Closes #46916 from pan3793/SPARK-48565. Authored-by: Cheng Pan Signed-off-by: Kent Yao --- core/src/main/scala/org/apache/spark/status/api/v1/api.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/scala/org/apache/spark/status/api/v1/api.scala b/core/src/main/scala/org/apache/spark/status/api/v1/api.scala index 7a0c69e294883..6ae1dce57f31c 100644 --- a/core/src/main/scala/org/apache/spark/status/api/v1/api.scala +++ b/core/src/main/scala/org/apache/spark/status/api/v1/api.scala @@ -510,7 +510,7 @@ case class StackTrace(elems: Seq[String]) { override def toString: String = elems.mkString def html: NodeSeq = { - val withNewLine = elems.foldLeft(NodeSeq.Empty) { (acc, elem) => + val withNewLine = elems.map(_.stripLineEnd).foldLeft(NodeSeq.Empty) { (acc, elem) => if (acc.isEmpty) { acc :+ Text(elem) } else {