This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-3.0 by this push:
new e85c881 [SPARK-34221][WEBUI] Ensure if a stage fails in the UI page,
the corresponding error message can be displayed correctly
e85c881 is described below
commit e85c881c21eafa26fa7421f7abb8421082b472bb
Author: neko <[email protected]>
AuthorDate: Wed Jan 27 10:01:57 2021 -0800
[SPARK-34221][WEBUI] Ensure if a stage fails in the UI page, the
corresponding error message can be displayed correctly
### What changes were proposed in this pull request?
Ensure that if a stage fails in the UI page, the corresponding error
message can be displayed correctly.
### Why are the changes needed?
errormessage is not handled properly in JavaScript. If the 'at' is not
exist, the error message on the page will be blank.
I made wochanges,
1. `msg.indexOf("at")` => `msg.indexOf("\n")`

As shows ablove, truncated at the 'at' position will result in a strange
abstract of the error message. If there is a `\n` worit is more reasonable to
truncate at the '\n' position.
2. If the `\n` does not exist check whether the msg is more than 100. If
true, then truncate the display to avoid too long error message
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Manual test shows as belows, just a js change:
before modified:

after modified

Closes #31314 from akiyamaneko/error_message_display_empty.
Authored-by: neko <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
(cherry picked from commit f1bc37e6244e959f1d950c450010dd6024b6ba5f)
Signed-off-by: Dongjoon Hyun <[email protected]>
---
core/src/main/resources/org/apache/spark/ui/static/stagepage.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/core/src/main/resources/org/apache/spark/ui/static/stagepage.js
b/core/src/main/resources/org/apache/spark/ui/static/stagepage.js
index 67d6d74..400b70f 100644
--- a/core/src/main/resources/org/apache/spark/ui/static/stagepage.js
+++ b/core/src/main/resources/org/apache/spark/ui/static/stagepage.js
@@ -861,7 +861,8 @@ $(document).ready(function () {
if (typeof msg === 'undefined') {
return "";
} else {
- var formHead = msg.substring(0,
msg.indexOf("at"));
+ var indexOfLineSeparator =
msg.indexOf("\n");
+ var formHead = indexOfLineSeparator > 0 ?
msg.substring(0, indexOfLineSeparator) : (msg.length > 100 ? msg.substring(0,
100) : msg);
var form = "<span
onclick=\"this.parentNode.querySelector('.stacktrace-details').classList.toggle('collapsed')\"
class=\"expand-details\">+details</span>";
var formMsg = "<div
class=\"stacktrace-details collapsed\"><pre>" + row.errorMessage +
"</pre></div>";
return formHead + form + formMsg;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]