-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-33906][WEBUI] Fix the bug of UI Executor page stuck due to undefined peakMemoryMetrics #30920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-33906][WEBUI] Fix the bug of UI Executor page stuck due to undefined peakMemoryMetrics #30920
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -414,38 +414,74 @@ $(document).ready(function () { | |
| }, | ||
| { | ||
| data: function (row, type) { | ||
| if (type !== 'display') | ||
| return row.peakMemoryMetrics.JVMHeapMemory; | ||
| else | ||
| return (formatBytes(row.peakMemoryMetrics.JVMHeapMemory, type) + ' / ' + | ||
| formatBytes(row.peakMemoryMetrics.JVMOffHeapMemory, type)); | ||
| var peakMemoryMetrics = row.peakMemoryMetrics; | ||
| if (typeof peakMemoryMetrics !== 'undefined') { | ||
| if (type !== 'display') | ||
| return peakMemoryMetrics.JVMHeapMemory; | ||
| else | ||
| return (formatBytes(peakMemoryMetrics.JVMHeapMemory, type) + ' / ' + | ||
| formatBytes(peakMemoryMetrics.JVMOffHeapMemory, type)); | ||
| } else { | ||
| if (type !== 'display') { | ||
| return 0; | ||
| } else { | ||
| return 'N/A'; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about returning
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. Replaced 'N/A' with '0.0 B / 0.0 B' |
||
| } | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| data: function (row, type) { | ||
| if (type !== 'display') | ||
| return row.peakMemoryMetrics.OnHeapExecutionMemory; | ||
| else | ||
| return (formatBytes(row.peakMemoryMetrics.OnHeapExecutionMemory, type) + ' / ' + | ||
| formatBytes(row.peakMemoryMetrics.OffHeapExecutionMemory, type)); | ||
| var peakMemoryMetrics = row.peakMemoryMetrics; | ||
| if (typeof peakMemoryMetrics !== 'undefined') { | ||
| if (type !== 'display') | ||
| return peakMemoryMetrics.OnHeapExecutionMemory; | ||
| else | ||
| return (formatBytes(peakMemoryMetrics.OnHeapExecutionMemory, type) + ' / ' + | ||
| formatBytes(peakMemoryMetrics.OffHeapExecutionMemory, type)); | ||
| } else { | ||
| if (type !== 'display') { | ||
| return 0; | ||
| } else { | ||
| return 'N/A'; | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| data: function (row, type) { | ||
| if (type !== 'display') | ||
| return row.peakMemoryMetrics.OnHeapStorageMemory; | ||
| else | ||
| return (formatBytes(row.peakMemoryMetrics.OnHeapStorageMemory, type) + ' / ' + | ||
| formatBytes(row.peakMemoryMetrics.OffHeapStorageMemory, type)); | ||
| var peakMemoryMetrics = row.peakMemoryMetrics; | ||
| if (typeof peakMemoryMetrics !== 'undefined') { | ||
| if (type !== 'display') | ||
| return peakMemoryMetrics.OnHeapStorageMemory; | ||
| else | ||
| return (formatBytes(peakMemoryMetrics.OnHeapStorageMemory, type) + ' / ' + | ||
| formatBytes(peakMemoryMetrics.OffHeapStorageMemory, type)); | ||
| } else { | ||
| if (type !== 'display') { | ||
| return 0; | ||
| } else { | ||
| return 'N/A'; | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| data: function (row, type) { | ||
| if (type !== 'display') | ||
| return row.peakMemoryMetrics.DirectPoolMemory; | ||
| else | ||
| return (formatBytes(row.peakMemoryMetrics.DirectPoolMemory, type) + ' / ' + | ||
| formatBytes(row.peakMemoryMetrics.MappedPoolMemory, type)); | ||
| var peakMemoryMetrics = row.peakMemoryMetrics; | ||
| if (typeof peakMemoryMetrics !== 'undefined') { | ||
| if (type !== 'display') | ||
| return peakMemoryMetrics.DirectPoolMemory; | ||
| else | ||
| return (formatBytes(peakMemoryMetrics.DirectPoolMemory, type) + ' / ' + | ||
| formatBytes(peakMemoryMetrics.MappedPoolMemory, type)); | ||
| } else { | ||
| if (type !== 'display') { | ||
| return 0; | ||
| } else { | ||
| return 'N/A'; | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| {data: 'diskUsed', render: formatBytes}, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to return
""rather than0like done here.Could you update the similar logic in the previous PR too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually in https://github.com/apache/spark/blob/master/core/src/main/resources/org/apache/spark/ui/static/stagepage.js#L501, it also returns 0.
If the column is invisible, it seems fine to return anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that returns 0 but I wonder it's impossible for us to tell that "the metrics is not updated yet" from "that the metrics is actually 0".