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

ASF GitHub Bot commented on FLINK-4631:
---------------------------------------

Github user StephanEwen commented on the issue:

    https://github.com/apache/flink/pull/2849
  
    I would actually not do that change. Partially initialized operators should 
receive a call to `cleanup()`.
    
    The cancellation/shutdown logic is quite tricky - mainly because of some 
legacy way to instantiate the tasks and operators.
    
    The right way to fix this is to actually follow the proper RAII pattern. 
That means:
      - going away from instantiating a blank invokable class, but having an 
invokable with a constructors that takes the `ExecutionEnvironment`
      - Change the `StreamOperator` to be more a factory for the actual 
operator, and instantiate it in the constructor of the task.


> NullPointerException during stream task cleanup
> -----------------------------------------------
>
>                 Key: FLINK-4631
>                 URL: https://issues.apache.org/jira/browse/FLINK-4631
>             Project: Flink
>          Issue Type: Bug
>    Affects Versions: 1.1.2
>         Environment: Ubuntu server 12.04.5 64 bit
> java version "1.8.0_40"
> Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
> Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
>            Reporter: Avihai Berkovitz
>             Fix For: 1.2.0
>
>
> If a streaming job failed during startup (in my case, due to lack of network 
> buffers), all the tasks are being cancelled before they started. This causes 
> many instances of the following exception:
> {noformat}
> 2016-09-18 14:17:12,177 ERROR 
> org.apache.flink.streaming.runtime.tasks.StreamTask           - Error during 
> cleanup of stream task
> java.lang.NullPointerException
>       at 
> org.apache.flink.streaming.runtime.tasks.OneInputStreamTask.cleanup(OneInputStreamTask.java:73)
>       at 
> org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:323)
>       at org.apache.flink.runtime.taskmanager.Task.run(Task.java:584)
>       at java.lang.Thread.run(Thread.java:745)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to