azagrebin commented on a change in pull request #9512:
[FLINK-13819][coordination] Introduce State for RpcEndpoint
URL: https://github.com/apache/flink/pull/9512#discussion_r316736973
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/rpc/RpcEndpoint.java
##########
@@ -323,6 +355,15 @@ public void validateRunsInMainThread() {
assert
MainThreadValidatorUtil.isRunningInExpectedThread(currentMainThread.get());
}
+ /**
+ * Rpc endpoint's state.
+ */
+ public enum State {
+ CREATED,
+ STARTED,
+ STOPPING
Review comment:
Good question. The start/stop happen asynchronously.
From what I understand, the main thread is ready to operate at the end of
the `doStart`.
But `onStop` can additionally trigger some extra asynchronous actions. Only
after they are done the endpoint is fully stopped until then it continues to
operate but it is known that it is being stopped.
Not sure whether we need more states to reflect the lifecycle better.
@tillrohrmann probably could help with the input here.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services