Uh oh!
There was an error while loading. Please reload this page.
[SPARK-31534][WEBUI][3.0] Text for tooltip should be escaped - #28359
Closed
sarutak wants to merge 1 commit into
Closed
[SPARK-31534][WEBUI][3.0] Text for tooltip should be escaped#28359sarutak wants to merge 1 commit into
sarutak wants to merge 1 commit into
Conversation
### What changes were proposed in this pull request? This PR escapes text for tooltip for DAG Viz and Timeline View. ### Why are the changes needed? This is a bug. Normally, DAG Viz and Timeline View show tooltip like as follows. <img width="278" alt="dag-viz-tooltip" src="https://user-images.githubusercontent.com/4736016/80127481-5a6c6880-85cf-11ea-8daf-cfd59aa3ba09.png"> <img width="477" alt="timeline-tooltip" src="https://user-images.githubusercontent.com/4736016/80127500-60624980-85cf-11ea-9b0f-cce301019e3a.png"> They contain a callsite properly. However, if a callsite contains characters which should be escaped for HTML without escaping , the corresponding tooltips wouldn't show the callsite and its following text properly. <img width="179" alt="dag-viz-tooltip-before-fixed" src="https://user-images.githubusercontent.com/4736016/80128480-b1267200-85d0-11ea-8035-ad68ae5fbcab.png"> <img width="261" alt="timeline-tooltip-before-fixed" src="https://user-images.githubusercontent.com/4736016/80128492-b5eb2600-85d0-11ea-9556-c48490110244.png"> The reason of this issue is that the source texts of the tooltip texts are not escaped. ### Does this PR introduce any user-facing change? No. ### How was this patch tested? I tested manually. First, I ran a job `sc.parallelize(1 to 10).collect` in Spark Shell then, visited AllJobsPage and JobPage and confirmed tooltip texts. <img width="196" alt="dag-viz-tooltip-fixed" src="https://user-images.githubusercontent.com/4736016/80128813-2db95080-85d1-11ea-82f8-90a1f4547f30.png"> <img width="363" alt="timeline-tooltip-fixed" src="https://user-images.githubusercontent.com/4736016/80128824-31e56e00-85d1-11ea-9818-492b72b1c56e.png"> I also added a testcase. Closesapache#28317 from sarutak/fix-tooltip. Authored-by: Kousuke Saruta <sarutak@oss.nttdata.com> Signed-off-by: Kousuke Saruta <sarutak@oss.nttdata.com>
sarutak
commented
Apr 27, 2020
MemberAuthor
The error message mentioned here is not shown in this branch. |
dongjoon-hyun
commented
Apr 27, 2020
Member
Thank you, @sarutak . |
This comment has been minimized.
This comment has been minimized.
sarutak
commented
Apr 27, 2020
MemberAuthor
retest this please. |
This comment has been minimized.
This comment has been minimized.
dongjoon-hyun
commented
Apr 27, 2020
Member
Retest this please. |
dongjoon-hyun
commented
Apr 27, 2020
Member
cc @gengliangwang , too. |
This comment has been minimized.
This comment has been minimized.
dongjoon-hyun
commented
Apr 27, 2020
Member
Retest this please. |
gengliangwang
approved these changes
Apr 27, 2020
This comment has been minimized.
This comment has been minimized.
gengliangwang
commented
Apr 28, 2020
Member
Retest this please. |
SparkQA
commented
Apr 28, 2020
Test build #121935 has finished for PR 28359 at commit
|
sarutak
commented
Apr 28, 2020
MemberAuthor
retest this please. |
dongjoon-hyun
approved these changes
Apr 28, 2020
Member
Maybe, we need to re-trigger this once more because this will be terminated at PST midnight. |
sarutak
commented
Apr 28, 2020
MemberAuthor
Ah, I see. Thanks. |
SparkQA
commented
Apr 28, 2020
Test build #121957 has finished for PR 28359 at commit
|
gengliangwang
commented
Apr 28, 2020
Member
retest this please. |
SparkQA
commented
Apr 28, 2020
Test build #121967 has finished for PR 28359 at commit
|
dongjoon-hyun pushed a commit
that referenced
this pull request
Apr 28, 2020
### What changes were proposed in this pull request? This PR backports #28317 which escapes text for tooltip for DAG Viz and Timeline View. ### Why are the changes needed? This is a bug. Normally, DAG Viz and Timeline View show tooltip like as follows. <img width="278" alt="dag-viz-tooltip" src="https://user-images.githubusercontent.com/4736016/80127481-5a6c6880-85cf-11ea-8daf-cfd59aa3ba09.png"> <img width="477" alt="timeline-tooltip" src="https://user-images.githubusercontent.com/4736016/80127500-60624980-85cf-11ea-9b0f-cce301019e3a.png"> They contain a callsite properly. However, if a callsite contains characters which should be escaped for HTML without escaping , the corresponding tooltips wouldn't show the callsite and its following text properly. <img width="179" alt="dag-viz-tooltip-before-fixed" src="https://user-images.githubusercontent.com/4736016/80128480-b1267200-85d0-11ea-8035-ad68ae5fbcab.png"> <img width="261" alt="timeline-tooltip-before-fixed" src="https://user-images.githubusercontent.com/4736016/80128492-b5eb2600-85d0-11ea-9556-c48490110244.png"> The reason of this issue is that the source texts of the tooltip texts are not escaped. ### Does this PR introduce any user-facing change? No. ### How was this patch tested? I tested manually. First, I ran a job `sc.parallelize(1 to 10).collect` in Spark Shell then, visited AllJobsPage and JobPage and confirmed tooltip texts. <img width="277" alt="timeline-tooltip-fixed-3 0" src="https://user-images.githubusercontent.com/4736016/80332616-41411180-8886-11ea-8d93-28e1c5265115.png"> <img width="191" alt="dag-tooltip-fixed-3 0" src="https://user-images.githubusercontent.com/4736016/80332625-44d49880-8886-11ea-8f2e-de8df1369e62.png"> And I confirmed that the appearance of the label of DAG-viz in StagePage is not changed. <img width="313" alt="stage-page-dag" src="https://user-images.githubusercontent.com/4736016/80332725-9b41d700-8886-11ea-9adb-40d50ad29f86.png"> I also added a testcase. With this testcase, an error message related to JavaScript is shown. `TypeError: Cannot call method "indexOf" of undefined (http://192.168.1.209:59376/static/spark-dag-viz.js#378)` This is thrown from `interpretLineBreak` in `spark-dag-viz.js`. HtmlUnit seems not to support `innerHTML` for text content (I tried replacing it with `textContent` and the error message is not shown). But DOMs which is needed by the testcase added is already rendered before `interpretLineBreak` is called. So the testcase successfully passes. Closes#28359 from sarutak/fix-tooltip-branch-3.0. Authored-by: Kousuke Saruta <sarutak@oss.nttdata.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
dongjoon-hyun
commented
Apr 28, 2020
Member
Thank you, @sarutak and @gengliangwang . Merged to branch-3.0. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR backports #28317 which escapes text for tooltip for DAG Viz and Timeline View.
Why are the changes needed?
This is a bug.
Normally, DAG Viz and Timeline View show tooltip like as follows.
They contain a callsite properly.


However, if a callsite contains characters which should be escaped for HTML without escaping , the corresponding tooltips wouldn't show the callsite and its following text properly.
The reason of this issue is that the source texts of the tooltip texts are not escaped.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
I tested manually.



First, I ran a job
sc.parallelize(1 to 10).collectin Spark Shell then, visited AllJobsPage and JobPage and confirmed tooltip texts.And I confirmed that the appearance of the label of DAG-viz in StagePage is not changed.
I also added a testcase.
With this testcase, an error message related to JavaScript is shown.
TypeError: Cannot call method "indexOf" of undefined (http://192.168.1.209:59376/static/spark-dag-viz.js#378)This is thrown from
interpretLineBreakinspark-dag-viz.js.HtmlUnit seems not to support
innerHTMLfor text content (I tried replacing it withtextContentand the error message is not shown).But DOMs which is needed by the testcase added is already rendered before
interpretLineBreakis called. So the testcase successfully passes.