[
https://issues.apache.org/jira/browse/FLINK-4368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15416710#comment-15416710
]
ASF GitHub Bot commented on FLINK-4368:
---------------------------------------
Github user tillrohrmann commented on the issue:
https://github.com/apache/flink/pull/2351
I think the changes look good.
You're right that this is a problem. The constructor should complete before
the rpc endpoint is reachable.
With the former implementation there was a similar problem though: First
you start the actor and then you initialize the self context. If a message
arrived between these two calls which triggers access to the self context, it
would have caused a NPE.
Maybe one can solve the problem by not publishing the connection address of
the rpc endpoint before the constructor has been executed? Then no gateway
could connect against the endpoint and send request until the whole endpoint
has been initialized.
Or we let the underlying rpc server (e.g. actor) ignore all messages until
he has been explicitly told differently. But this would entail that the user
has to call something like `rpcEndpoint.startReceivingMessages()`.
> Eagerly initialize RrcProtocol members
> --------------------------------------
>
> Key: FLINK-4368
> URL: https://issues.apache.org/jira/browse/FLINK-4368
> Project: Flink
> Issue Type: Sub-task
> Components: Distributed Coordination
> Environment: FLIP-6 feature branch
> Reporter: Stephan Ewen
>
> The members of the RPC endpoint (RpcProtocol) are lazily created upon the
> {{start()}} call.
> I suggest to initialize them eagerly as they seem to be integral parts
> without which several functions cannot work properly.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)