Ngone51 commented on a change in pull request #28370:
URL: https://github.com/apache/spark/pull/28370#discussion_r426398285
##########
File path: core/src/main/scala/org/apache/spark/storage/BlockManager.scala
##########
@@ -1829,7 +1901,58 @@ 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(conf: SparkConf) {
+ @volatile private var stopped = false
+ private val sleepInterval = conf.get(
+ config.STORAGE_DECOMMISSION_REPLICATION_REATTEMPT_INTERVAL)
+
+ private val blockReplicationThread = new Thread {
+ override def run(): Unit = {
+ var failures = 0
+ while (blockManagerDecommissioning
+ && !stopped
+ && !Thread.interrupted()
Review comment:
I believe in normal cases like `wait`, `sleep`, the status will be
cleared according to JDK doc:
```
* @throws InterruptedException
* if any thread has interrupted the current thread. The
* <i>interrupted status</i> of the current thread is
* cleared when this exception is thrown.
```
And even if the status is not be cleared in other cases, the following
`Thread.sleep(sleepInterval)` will throw `InterruptedException` firstly and set
`stopped` to true and `Thread.interrupted()` still does not take effect.
----------------------------------------------------------------
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]