You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "LIU (Jira)" <ji...@apache.org> on 2021/04/20 17:11:00 UTC

[jira] [Created] (SPARK-35154) Rpc env not shutdown when shutdown method call by endpoint onStop

LIU created SPARK-35154:
---------------------------

             Summary: Rpc env not shutdown when shutdown method call by endpoint onStop
                 Key: SPARK-35154
                 URL: https://issues.apache.org/jira/browse/SPARK-35154
             Project: Spark
          Issue Type: Bug
          Components: Spark Core
    Affects Versions: 3.0.0
         Environment: spark-3.x
            Reporter: LIU


when i use this code to work,  Rpc thread hangs up and not close gracefully. i think when rpc thread called shutdown on OnStop method, it will try to put 

MessageLoop.PoisonPill to return and stop thread in rpc pool. In spark 3.x, it will make others thread return & stop but current thread which call OnStop method to await current pool to stop. it makes current thread not stop, and pending program.

I'm not sure that needs to be improved or not?

 
{code:java}
//代码占位符{code}
test("Rpc env not shutdown when shutdown method call by endpoint onStop") {
    val rpcEndpoint = new RpcEndpoint {
        override val rpcEnv: RpcEnv = env
        override def onStop(): Unit = {
            env.shutdown()
            env.awaitTermination()
        }

        override def receiveAndReply(context: RpcCallContext): PartialFunction[Any, Unit] ={
            case m => context.reply(m)
        }

    }
   env.setupEndpoint("test", rpcEndpoint)
   rpcEndpoint.stop()
   env.awaitTermination()
}

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org