baohe-zhang opened a new pull request #30920:
URL: https://github.com/apache/spark/pull/30920


   ### What changes were proposed in this pull request?
   Check if the executorSummary.peakMemoryMetrics is defined before accessing 
it. Without checking, the UI has risked being stuck at the Executors page.
   
   ### Why are the changes needed?
   App live UI may stuck at Executors page without this fix.
   Steps to reproduce:
   In mac OS standalone mode, open a spark-shell
   $SPARK_HOME/bin/spark-shell --master spark://localhost:7077
   
   val x = sc.makeRDD(1 to 100000, 5)
   x.count()
   
   Then open the app UI in the browser, and click the Executors page, will get 
stuck at this page:
   
![image](https://user-images.githubusercontent.com/26694233/103105677-ca1a7380-45f4-11eb-9245-c69f4a4e816b.png)
   
   Also, the return JSON from API endpoint 
http://localhost:4040/api/v1/applications/app-20201224134418-0003/executors 
miss "peakMemoryMetrics" for executor objects. I attached the full json text in 
https://issues.apache.org/jira/browse/SPARK-33906.
   
   I debugged it and observed that ExecutorMetricsPoller
   .getExecutorUpdates returns an empty map, which causes peakExecutorMetrics 
to None in 
https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/status/LiveEntity.scala#L345.
 The possible reason for returning the empty map is that the stage completion 
time is shorter than the heartbeat interval, so the stage entry in stageTCMP 
has already been removed before the reportHeartbeat is called.
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   ### How was this patch tested?
   Manual test, rerun the steps of bug reproduce and see the bug is gone.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to