[
https://issues.apache.org/jira/browse/FLINK-4355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15422302#comment-15422302
]
ASF GitHub Bot commented on FLINK-4355:
---------------------------------------
Github user tillrohrmann commented on the issue:
https://github.com/apache/flink/pull/2353
Really good code @StephanEwen :-) I like it a lot that you've pulled out
the registration logic from the `TaskExecutor`. This makes it much cleaner and
easier to test.
I'm actually wondering whether we can actually take it a step further. What
I've noticed is that we have to pass the `TaskExecutor` to different places to
have access to the its state and to run things in the main thread context. I'm
not sure whether this is really necessary.
The registration information should be more or less constant and the main
thing which has to happen in the main thread context is the setting of the
connected gateway. So wouldn't it be possible that the
`ResourceManagerRegistration` is something like a cancelable future which is
instantiated with all necessary information. It performs the registration logic
completely in the background and once it is completed we can create a
`TaskExecutorToResourceManagerConnection` in the main thread context. Whenever
we have to start a new registration, we cancel the future (if there is still
another registration running).
Pulling out the `TaskExecutor` from the registration process has the
advantage that the components are even further separated and, thus, easier to
test.
> Implement TaskManager side of registration at ResourceManager
> -------------------------------------------------------------
>
> Key: FLINK-4355
> URL: https://issues.apache.org/jira/browse/FLINK-4355
> Project: Flink
> Issue Type: Sub-task
> Components: Cluster Management
> Reporter: Zhijiang Wang
> Assignee: Stephan Ewen
>
> If the {{TaskManager}} is unregistered, it should try and register at the
> {{ResourceManager}} leader. The registration messages are fenced via the
> {{RmLeaderID}}.
> The ResourceManager may acknowledge the registration (or respond that the
> TaskManager is AlreadyRegistered) or refuse the registration.
> Upon registration refusal, the TaskManager may have to kill itself.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)