Github user zsxwing commented on the pull request:
https://github.com/apache/spark/pull/5268#issuecomment-88135195
There are two things that's worth to review carefully:
1. Calling `setupEndpointRef ` or `setupThreadSafeEndpointRef ` to create
`RpcEndpoint`. When I was doing this PR, I found that it's inconvenient to
check if using `setupEndpointRef ` or `setupThreadSafeEndpointRef ` correctly.
The problem is I need to read the implementation of `RpcEndpoint` in one file
at first, search and switch to other places that creating `RpcEndpoint`. I'm
wondering if the current design of `setupEndpointRef ` and
`setupThreadSafeEndpointRef` can be improved.
One possible improvement is using a special trait, such as
`ThreadSafeRpcEndpoint` to mark the RpcEndpoint that needs to be thread-safe,
and only have one method, `setupEndpointRef`, to setup RpcEndpoint. We can use
isInstanceOf to distinguish them.
2. If a message is passed to `send`, the receiver side should handle it in
`receive`. If a message is passed to `sendWithReply` or `askWithReply`, the
receiver side should handle it in `receiveAndReply`. If using a wrong method,
the message will be lost (of cause, will be logged).
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]