spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [spark] jiangxb1987 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`
Date Wed, 09 Sep 2020 21:38:42 GMT

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



##########
File path: core/src/main/scala/org/apache/spark/rpc/netty/Inbox.scala
##########
@@ -200,6 +200,17 @@ 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 dealWithFatalError(fatal: Throwable): Unit = {
+      inbox.synchronized {
+        // Should reduce the number of active threads before throw the error
+        if (numActiveThreads > 0) {

Review comment:
       if the condition is not going to happen, I'd use `assert(numActiveThreads > 0)`
instead of `if`




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


Mime
View raw message