Ngone51 commented on code in PR #52919:
URL: https://github.com/apache/spark/pull/52919#discussion_r2501693755


##########
core/src/main/scala/org/apache/spark/storage/BlockManagerMaster.scala:
##########
@@ -223,7 +227,18 @@ class BlockManagerMaster(
         log"${MDC(ERROR, e.getMessage)}", e)
     )(ThreadUtils.sameThread)
     if (blocking) {
-      // the underlying Futures will timeout anyway, so it's safe to use 
infinite timeout here
+      handleRemoveBlockBlockingTimeout(future)
+    }
+  }
+
+  private def handleRemoveBlockBlockingTimeout(future: Future[_]): Unit = {
+    if (cleanBlockBlockingTimeout.isDefined) {
+      new RpcTimeout(FiniteDuration(cleanBlockBlockingTimeout.get, 
TimeUnit.SECONDS),
+        CLEANER_REFERENCE_TRACKING_BLOCKING_TIMEOUT.key).awaitResult(future)
+    } else {
+      // Normally, the underlying Futures will timeout anyway,
+      // so it's safe to use infinite timeout here. In extreme case,
+      // Driver can't crease thread handling this rpc, here will be stuck 
forever.
       RpcUtils.INFINITE_TIMEOUT.awaitResult(future)

Review Comment:
   Do we still want this case? It look like a bug to me.



##########
core/src/main/scala/org/apache/spark/storage/BlockManagerMaster.scala:
##########
@@ -223,7 +227,18 @@ class BlockManagerMaster(
         log"${MDC(ERROR, e.getMessage)}", e)
     )(ThreadUtils.sameThread)
     if (blocking) {
-      // the underlying Futures will timeout anyway, so it's safe to use 
infinite timeout here
+      handleRemoveBlockBlockingTimeout(future)
+    }
+  }
+
+  private def handleRemoveBlockBlockingTimeout(future: Future[_]): Unit = {

Review Comment:
   How about
   ```suggestion
     private def waitForBlockRemoval(future: Future[_]): Unit = {
   ```



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

To unsubscribe, e-mail: [email protected]

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