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/05/25 17:37:40 UTC
[GitHub] [spark] sumeetgajjar commented on a change in pull request #32114: [SPARK-35011][CORE] Avoid Block Manager registrations when StopExecutor msg is in-flight
sumeetgajjar commented on a change in pull request #32114:
URL: https://github.com/apache/spark/pull/32114#discussion_r639022211
##########
File path: core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala
##########
@@ -728,14 +738,28 @@ class BlockManagerMasterEndpoint(
private def getExecutorEndpointRef(executorId: String): Option[RpcEndpointRef] = {
for (
blockManagerId <- blockManagerIdByExecutor.get(executorId);
- info <- blockManagerInfo.get(blockManagerId)
+ info <- blockManagerInfo.get(blockManagerId).filter(_.isAlive)
) yield {
info.storageEndpoint
}
}
override def onStop(): Unit = {
askThreadPool.shutdownNow()
+ blockManagerInfoCleaner.shutdownNow()
+ }
+
+ private def cleanBlockManagerInfo(): Unit = {
+ logDebug("Cleaning blockManagerInfo")
+ val now = System.currentTimeMillis()
+ val (expiredEntries, _) = blockManagerInfo.partition { case (_, bmInfo) =>
+ // bmInfo.executorRemovalTs.get cannot be None when BM is not alive
+ !bmInfo.isAlive && (now - bmInfo.executorRemovalTs.get) > executorTimeoutMs
+ }
Review comment:
Done.
##########
File path: core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala
##########
@@ -878,4 +903,15 @@ private[spark] class BlockManagerInfo(
def clear(): Unit = {
_blocks.clear()
}
+
+ def executorRemovalTs: Option[Long] = _executorRemovalTs
+
+ def isAlive: Boolean = _executorRemovalTs.isEmpty
+
+ def updateExecutorRemovalTs(): Unit = {
+ if (!isAlive) {
+ logWarning(s"executorRemovalTs is already set to ${_executorRemovalTs.get}")
+ }
+ _executorRemovalTs = Some(System.currentTimeMillis())
Review comment:
Done.
--
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