attilapiros commented on a change in pull request #32790:
URL: https://github.com/apache/spark/pull/32790#discussion_r645967333



##########
File path: 
core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala
##########
@@ -645,7 +649,7 @@ class BlockManagerMasterEndpoint(
     val locations = 
Option(blockLocations.get(blockId)).map(_.toSeq).getOrElse(Seq.empty)
     val status = locations.headOption.flatMap { bmId =>
       if (externalShuffleServiceRddFetchEnabled && bmId.port == 
externalShuffleServicePort) {
-        Option(blockStatusByShuffleService(bmId).get(blockId))
+        blockStatusByShuffleService.get(bmId).flatMap(m => 
Option(m.get(blockId)))

Review comment:
       After this PR `blockStatusByShuffleService.get(bmId)` can be `None` and 
even when it has some value for the key then even `m.get(blockId)` can be 
`null` as `m` is a Java `HashMap`. 




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