[
https://issues.apache.org/jira/browse/FLINK-4714?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15892409#comment-15892409
]
Till Rohrmann commented on FLINK-4714:
--------------------------------------
Hi [~tonywei],
I think you're right that the cleanest approach would be to add a
{{initialize}} or {{open}} method to {{AbstractInvokable}} which is being
called by {{Task}} before setting the state from {{DEPLOYING}} to {{RUNNING}}.
The subclasses of {{AbstractInvokable}} can then implement this method. The
{{StreamTask}}, for example, would then do all its state restoration in this
method.
Whether it makes sense to move the initialization code for each
{{AbstractInvokable}} to the newly introduced method, should be judged on a
case to case basis. For the stream tasks it makes sense. For the batch abstract
invokables it is not so critical.
> Set task state to RUNNING after state has been restored
> -------------------------------------------------------
>
> Key: FLINK-4714
> URL: https://issues.apache.org/jira/browse/FLINK-4714
> Project: Flink
> Issue Type: Improvement
> Components: Distributed Coordination, State Backends, Checkpointing
> Affects Versions: 1.2.0
> Reporter: Till Rohrmann
> Assignee: Wei-Che Wei
>
> The task state is set to {{RUNNING}} as soon as the {{Task}} is executed.
> That, however, happens before the state of the {{StreamTask}} invokable has
> been restored. As a result, the {{CheckpointCoordinator}} starts to trigger
> checkpoints even though the {{StreamTask}} is not ready.
> In order to avoid aborting checkpoints and properly start it, we should
> switch the task state to {{RUNNING}} after the state has been restored.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)