[ 
https://issues.apache.org/jira/browse/FLINK-17012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17089260#comment-17089260
 ] 

Wenlong Lyu commented on FLINK-17012:
-------------------------------------

[~pnowojski] I think whether the task is ready to process data is what users 
really care. Including the initialization step in the DEPLOYING state of task 
can be an option.
 
I agrees that we should avoid `initialize()` or `configure()` if possible. 
Regarding initializing in constructor, I think we would need to do more do more 
check (at least null check) when clean up in the exception catch clause and it 
would be impossible clean up externally which may cause resource leak when we 
trying to cancel a task by interrupting it, because the Invokable is not 
accessable when failed in constructor, we may need a Factory as [~pnowojski] 
suggested,  which can construct and initialize all components(statebackend, 
operator chain etc.) , create task by providing them explicitly, and clean them 
up when necessary.

> Expose stage of task initialization
> -----------------------------------
>
>                 Key: FLINK-17012
>                 URL: https://issues.apache.org/jira/browse/FLINK-17012
>             Project: Flink
>          Issue Type: Improvement
>          Components: Runtime / Metrics, Runtime / Task
>            Reporter: Wenlong Lyu
>            Priority: Major
>
> Currently a task switches to running before fully initialized, does not take 
> state initialization and operator initialization(#open ) in to account, which 
> may take long time to finish. As a result, there would be a weird phenomenon 
> that all tasks are running but throughput is 0. 
> I think it could be good if we can expose the initialization stage of tasks. 
> What to you think?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to