[
https://issues.apache.org/jira/browse/FLINK-7295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16107021#comment-16107021
]
ASF GitHub Bot commented on FLINK-7295:
---------------------------------------
Github user asfgit closed the pull request at:
https://github.com/apache/flink/pull/4420
> Add callback for proper RpcEndpoint shut down
> ---------------------------------------------
>
> Key: FLINK-7295
> URL: https://issues.apache.org/jira/browse/FLINK-7295
> Project: Flink
> Issue Type: Sub-task
> Components: Distributed Coordination
> Affects Versions: 1.4.0
> Reporter: Till Rohrmann
> Assignee: Till Rohrmann
> Fix For: 1.4.0
>
>
> In order to properly shut down {{RpcEndpoints}} it is necessary to have a
> method which is called by the main thread in case of a shut down and allows
> to properly close and clean up internal state. At the moment, this clean up
> work is done by overriding the {{RpcEndpoint#shutDown}} method which can be
> called by a different thread than the main thread. This is problematic since
> it violates the {{RpcEndpoint}} contract.
> I propose to change the behaviour of {{RpcEndpoint#shutDown}} to be
> asynchronous. Calling this method will send a message to the {{RpcEndpoint}}
> which triggers the call of the clean up method and the termination of the
> endpoint.
> In order to obtain the same behaviour as before, the user can obtain the
> termination future on which it can wait after sending the request to shut
> down the {{RpcEndpoint}}.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)