Github user rxin commented on a diff in the pull request: https://github.com/apache/spark/pull/9197#discussion_r42831391 --- Diff: core/src/main/scala/org/apache/spark/rpc/netty/NettyRpcEnv.scala --- @@ -127,37 +170,28 @@ private[netty] class NettyRpcEnv( val ack = response.asInstanceOf[Ack] logTrace(s"Received ack from ${ack.sender}") case Failure(e) => - logError(s"Exception when sending $message", e) + logWarning(s"Exception when sending $message", e) }(ThreadUtils.sameThread) } else { // Message to a remote RPC endpoint. - try { - // `createClient` will block if it cannot find a known connection, so we should run it in - // clientConnectionExecutor - clientConnectionExecutor.execute(new Runnable { - override def run(): Unit = Utils.tryLogNonFatalError { - val client = clientFactory.createClient(remoteAddr.host, remoteAddr.port) - client.sendRpc(serialize(message), new RpcResponseCallback { - - override def onFailure(e: Throwable): Unit = { - logError(s"Exception when sending $message", e) - } - - override def onSuccess(response: Array[Byte]): Unit = { - val ack = deserialize[Ack](response) - logDebug(s"Receive ack from ${ack.sender}") - } - }) - } - }) - } catch { - case e: RejectedExecutionException => - // `send` after shutting clientConnectionExecutor down, ignore it - logWarning(s"Cannot send $message because RpcEnv is stopped") - } + postToOutbox(remoteAddr, OutboxMessage(serialize(message), new RpcResponseCallback { + + override def onFailure(e: Throwable): Unit = { + logWarning(s"Exception when sending $message", e) + } + + override def onSuccess(response: Array[Byte]): Unit = { + val ack = deserialize[Ack](response) + logDebug(s"Receive ack from ${ack.sender}") --- End diff -- is this log useful? maybe we don't need to do much here ...
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org