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 2020/09/03 12:14:59 UTC

[GitHub] [spark] Ngone51 commented on a change in pull request #29580: [SPARK-32738][CORE] Should reduce the number of active threads if fatal error happens in `Inbox.process`

Ngone51 commented on a change in pull request #29580:
URL: https://github.com/apache/spark/pull/29580#discussion_r482931629



##########
File path: core/src/main/scala/org/apache/spark/rpc/netty/Inbox.scala
##########
@@ -200,6 +200,16 @@ private[netty] class Inbox(val endpointName: String, val endpoint: RpcEndpoint)
    * Calls action closure, and calls the endpoint's onError function in the case of exceptions.
    */
   private def safelyCall(endpoint: RpcEndpoint)(action: => Unit): Unit = {
+    def dealWithFatalException(fatal: Throwable): Unit = {
+      inbox.synchronized {
+        // Should reduce the number of active threads before throw exception
+        if (numActiveThreads != 0) {
+          numActiveThreads -= 1
+        }
+      }
+      throw fatal

Review comment:
       Shall we log this error?




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