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

Stephan Ewen commented on FLINK-17012:
--------------------------------------

Agreed, the factory would be the cleanest approach.

I am wondering, though, if the constructor would be that bad, though. Here is 
my thinking:

  - The contract is pretty simple: when you have an exception, clean up exactly 
what you initialized.

  - To properly abort the state loading, we need two things:
     1. We need to close the streams and state manager. Both exist before the 
constructor and are registered in the CloseableRegistry of the task, so they 
always get eagerly closed upon cancellation in order to "fail fast" all I/O ops.
     2. Interrupting the thread. This also does not need access to the task.


> 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