Skip to content

Commit 1e50f71

Browse files
committed
Update as per review and increase the max height of the stack trace details
1 parent 94f2566 commit 1e50f71

File tree

4 files changed

+26
-5
lines changed

4 files changed

+26
-5
lines changed

core/src/main/resources/org/apache/spark/ui/static/webui.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,20 @@ pre {
120120
border: none;
121121
}
122122

123+
.stacktrace-details {
124+
max-height: 300px;
125+
overflow-y: auto;
126+
margin: 0;
127+
transition: max-height 0.5s ease-out, padding 0.5s ease-out;
128+
}
129+
130+
.stacktrace-details.collapsed {
131+
max-height: 0;
132+
padding-top: 0;
133+
padding-bottom: 0;
134+
border: none;
135+
}
136+
123137
span.expand-additional-metrics {
124138
cursor: pointer;
125139
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,13 +427,15 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") {
427427
error
428428
})
429429
val details = if (isMultiline) {
430-
<span onclick="this.parentNode.querySelector('.stage-details').classList.toggle('collapsed')"
430+
// scalastyle:off
431+
<span onclick="this.parentNode.querySelector('.stacktrace-details').classList.toggle('collapsed')"
431432
class="expand-details">
432433
+details
433434
</span> ++
434-
<div class="stage-details collapsed">
435+
<div class="stacktrace-details collapsed">
435436
<pre>{error}</pre>
436437
</div>
438+
// scalastyle:on
437439
} else {
438440
""
439441
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,15 @@ private[ui] class FailedStageTable(
207207
failureReason
208208
})
209209
val details = if (isMultiline) {
210-
<span onclick="this.parentNode.querySelector('.stage-details').classList.toggle('collapsed')"
210+
// scalastyle:off
211+
<span onclick="this.parentNode.querySelector('.stacktrace-details').classList.toggle('collapsed')"
211212
class="expand-details">
212213
+details
213214
</span> ++
214-
<div class="stage-details collapsed">
215+
<div class="stacktrace-details collapsed">
215216
<pre>{failureReason}</pre>
216217
</div>
218+
// scalastyle:on
217219
} else {
218220
""
219221
}

core/src/main/scala/org/apache/spark/util/Utils.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1598,7 +1598,9 @@ private[spark] object Utils extends Logging {
15981598

15991599
/** Return a nice string representation of the exception, including the stack trace. */
16001600
def exceptionString(e: Throwable): String = {
1601-
if (e == null) ""
1601+
if (e == null) {
1602+
""
1603+
}
16021604
else {
16031605
val stringWriter = new StringWriter()
16041606
e.printStackTrace(new PrintWriter(stringWriter))
@@ -1609,6 +1611,7 @@ private[spark] object Utils extends Logging {
16091611
/**
16101612
* Return a nice string representation of the exception, including the stack trace.
16111613
* It's only used for backward compatibility.
1614+
* Note: deprecated because it does not include the exception's cause.
16121615
*/
16131616
@deprecated("Use exceptionString(Throwable) instead", "1.2.0")
16141617
def exceptionString(

0 commit comments

Comments
 (0)