prakharjain09 commented on a change in pull request #27864: [SPARK-20732][CORE]
Decommission cache blocks to other executors when an executor is decommissioned
URL: https://github.com/apache/spark/pull/27864#discussion_r405529672
##########
File path: core/src/main/scala/org/apache/spark/storage/BlockManager.scala
##########
@@ -1829,7 +1895,50 @@ private[spark] class BlockManager(
data.dispose()
}
+ /**
+ * Class to handle block manager decommissioning retries
+ * It creates a Thread to retry offloading all RDD cache blocks
+ */
+ private class BlockManagerDecommissionManager {
+ @volatile private var stopped = false
+ private val cacheReplicationThread = new Thread {
+ override def run(): Unit = {
+ while (blockManagerDecommissioning && !stopped) {
+ try {
+ logDebug(s"Attempting to replicate all cached RDD blocks")
+ offloadRddCacheBlocks()
+ logInfo(s"Attempt to replicate all cached blocks done")
+ val sleepInterval = if (Utils.isTesting) 100 else 30000
+ Thread.sleep(sleepInterval)
+ } catch {
+ case _: InterruptedException =>
+ // no-op
+ case NonFatal(e) =>
+ logError("Error occurred while trying to " +
+ "replicate cached RDD blocks for block manager
decommissioning", e)
+ }
+ }
+ }
+ }
+ cacheReplicationThread.setDaemon(true)
+ cacheReplicationThread.setName("cache-replication-thread")
+
+ def start(): Unit = {
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]