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/04/13 11:31:09 UTC

[GitHub] [spark] attilapiros commented on a change in pull request #32114: [SPARK-35011][CORE] Avoid Block Manager registrations when StopExecutor msg is in-flight

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



##########
File path: core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala
##########
@@ -510,14 +514,20 @@ class BlockManagerMasterEndpoint(
   }
 
   /**
-   * Returns the BlockManagerId with topology information populated, if available.
+   * Returns an option of BlockManagerId. If topology information is available, it populated inside
+   * BlockManagerId. If the BlockManager belongs to a recently removed executor, None is returned.
    */
   private def register(
       idWithoutTopologyInfo: BlockManagerId,
       localDirs: Array[String],
       maxOnHeapMemSize: Long,
       maxOffHeapMemSize: Long,
-      storageEndpoint: RpcEndpointRef): BlockManagerId = {
+      storageEndpoint: RpcEndpointRef): Option[BlockManagerId] = {
+    if (Option(recentlyRemovedExecutors.getIfPresent(idWithoutTopologyInfo.executorId)).isDefined) {

Review comment:
       Nit: for just checking the object is null you do not need to build an Option (Option is good when when you pass the object to another method to emphasize it can be null). 




-- 
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:
users@infra.apache.org



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