Till Rohrmann created FLINK-11551: ------------------------------------- Summary: Allow RpcEndpoints to execute asynchronous stop operations Key: FLINK-11551 URL: https://issues.apache.org/jira/browse/FLINK-11551 Project: Flink Issue Type: Improvement Components: Distributed Coordination Affects Versions: 1.7.1, 1.8.0 Reporter: Till Rohrmann Assignee: Till Rohrmann Fix For: 1.8.0
Some {{RpcEndpoints}} would benefit from being able to run asynchronous stop operations in the main thread executor. At the moment, this is not possible since {{RpcEndpoint#postStop}} is called by by {{UntypedActor#postStop}} which is the last call for an actor. I suggest to introduce a new method {{RpcEndpoint#onStop}} which is executed when the {{RpcEndpoint}} is requested to terminate. Internally, this method will be called when the {{UntypedActor}} is still running, thus, allowing to execute arbitrary other messages (e.g. asynchronous operations in the main thread executor). Only after the future returned by {{onStop}} is completed, the underlying {{UntypedActor}} will shut down. -- This message was sent by Atlassian JIRA (v7.6.3#76005)