You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/08/24 01:49:09 UTC

[GitHub] [spark] Ngone51 commented on a change in pull request #33812: [SPARK-36564][CORE] Fix NullPointerException in LiveRDDDistribution.toApi

Ngone51 commented on a change in pull request #33812:
URL: https://github.com/apache/spark/pull/33812#discussion_r694423960



##########
File path: core/src/main/scala/org/apache/spark/status/LiveEntity.scala
##########
@@ -553,7 +553,7 @@ private class LiveRDDDistribution(exec: LiveExecutor) {
   def toApi(): v1.RDDDataDistribution = {
     if (lastUpdate == null) {
       lastUpdate = new v1.RDDDataDistribution(
-        weakIntern(exec.hostPort),
+        weakIntern(if (exec.hostPort != null) exec.hostPort else exec.host),

Review comment:
       @tgravescs  `exec.hostPort` or `exec.host` will be only called when there's a corresponding `LiveExecutor`. And `LiveExecutor` is added either by `SparkListenerExecutorAdded` or `onBlockManagerAdded`, and `SparkListenerExecutorAdded` set the `host` and `onBlockManagerAdded` set the `hostPort`. So, `host` and `hostPort` can't be `null` at the same time.




-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org