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 2022/05/26 05:09:58 UTC

[GitHub] [spark] mridulm commented on a diff in pull request #35683: [SPARK-30835][SPARK-39018][CORE][YARN] Add support for YARN decommissioning when ESS is disabled

mridulm commented on code in PR #35683:
URL: https://github.com/apache/spark/pull/35683#discussion_r882319090


##########
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocator.scala:
##########
@@ -422,6 +446,27 @@ private[yarn] class YarnAllocator(
     }
   }
 
+  private def handleNodesInDecommissioningState(allocateResponse: AllocateResponse): Unit = {
+    try {
+      // Some of the nodes are put in decommissioning state where RM did allocate
+      // resources on those nodes for earlier allocateResource calls, so notifying driver
+      // to put those executors in decommissioning state
+      allocateResponse.getUpdatedNodes.asScala.filter (node =>
+        node.getNodeState == NodeState.DECOMMISSIONING &&
+          !decommissioningNodesCache.containsKey(getHostAddress(node)))
+        .foreach { node =>
+          val host = getHostAddress(node)
+          driverRef.send(DecommissionExecutorsOnHost(host))
+          decommissioningNodesCache.put(host, true)
+        }
+    } catch {
+      case e: Exception => logError("Sending Message to Driver to Decommission Executors " +
+        "on Decommissioning Nodes failed", e)

Review Comment:
   Is this `catch` only for `driverRef.send` or anything else as well ?
   The `send` is not expected to fail - any particular reason to include this catch block ?



-- 
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: reviews-unsubscribe@spark.apache.org

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