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

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

Github user asfgit closed the pull request at:

    https://github.com/apache/flink/pull/5716


> fix resource close in 
> `StreamTaskStateInitializerImpl.streamOperatorStateContext()`
> -----------------------------------------------------------------------------------
>
>                 Key: FLINK-9022
>                 URL: https://issues.apache.org/jira/browse/FLINK-9022
>             Project: Flink
>          Issue Type: Bug
>          Components: State Backends, Checkpointing
>    Affects Versions: 1.5.0
>            Reporter: Sihua Zhou
>            Assignee: Sihua Zhou
>            Priority: Blocker
>             Fix For: 1.5.0
>
>
> We have the following code in 
> {{StreamTaskStateInitializerImpl.streamOperatorStateContext()}} which is 
> incorrect:
> {code}
> } catch (Exception ex) {
>       // cleanup if something went wrong before results got published.
>       if 
> (streamTaskCloseableRegistry.unregisterCloseable(keyedStatedBackend)) {
>               IOUtils.closeQuietly(keyedStatedBackend);
>       }
>       if 
> (streamTaskCloseableRegistry.unregisterCloseable(operatorStateBackend)) {
>               IOUtils.closeQuietly(keyedStatedBackend); // this should close 
> operatorStateBackend
>       }
>       if 
> (streamTaskCloseableRegistry.unregisterCloseable(rawKeyedStateInputs)) {
>               IOUtils.closeQuietly(rawKeyedStateInputs);
>       }
>       if 
> (streamTaskCloseableRegistry.unregisterCloseable(rawOperatorStateInputs)) {
>               IOUtils.closeQuietly(rawOperatorStateInputs);
>       }
>       if 
> (streamTaskCloseableRegistry.unregisterCloseable(rawOperatorStateInputs)) {
>               IOUtils.closeQuietly(rawOperatorStateInputs);
>       }
>       throw new Exception("Exception while creating 
> StreamOperatorStateContext.", ex);
> }
> {code}        



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to