Executor will start an actor system for remoting after rpcenv has been created.You can refer to SparkEnv.And why not start a netty server?I think, driver must handle all the executors' connetction but executor no need to.So an actor system server is enough?
After looking into code of branch-2.1.
I found out Driver first handle executor connections by NettyRpcHandler.
Once a connection arrive,driver's NettyRpcHandler will call receive,in which NettyRpcHandler#internalReceive will be called.
And then NettyEnv#deserialize will be called,which will update NettyRpcEnv.currentClient used for NettyRpcEndpointRef#client.
So although rpcaddress is null,the executor;s endpoint ref remained by driver will use the client to send message to executor.
Correct me if you found out some other useful message.Thanks!
This post has NOT been accepted by the mailing list yet.
Yes!you are right!
First, in "CoarseGrainedSchedulerBackend.scala"，there is a "executorRef.send(RegisteredExecutor)".
And then, go to the implemention of .send()，you will find it will call "netty.send(RequestMessage(nettyEnv.address,this,message))",and "this" is the receiver of the message.
And then, go to the "NettyRpcEnv#send", of course,remoteAddr is null(because executorRef.address is null). So go to the "NettyRpcEnv#postToOutbox", although the receiver.address is null, the receiver.client is not null. And Finally, messge will be send in "message.sendWith(receiver.client)"