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

vinoyang commented on FLINK-9019:
---------------------------------

sorry, I was busy and have not joined the discussion. Agree with [~sihuazhou] , 
here the _closeableRegistry_ would be used in a anonymous implementation of 
'*CloseableIterable<StatePartitionStreamProvider>*' as a return type. I think 
we could fix this issue with simply moving the constraction into the if block, 
just like :
{code:java}
if (rawOperatorState != null) {
   final CloseableRegistry closeableRegistry = new CloseableRegistry();

   return new CloseableIterable<StatePartitionStreamProvider>() {

   }
}

return CloseableIterable.empty();
{code}
 

> Unclosed closeableRegistry in 
> StreamTaskStateInitializerImpl#rawOperatorStateInputs
> -----------------------------------------------------------------------------------
>
>                 Key: FLINK-9019
>                 URL: https://issues.apache.org/jira/browse/FLINK-9019
>             Project: Flink
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Assignee: vinoyang
>            Priority: Minor
>
> {code}
>      final CloseableRegistry closeableRegistry = new CloseableRegistry();
> ...
>      if (rawOperatorState != null) {
> ...
>       }
>     }
>     return CloseableIterable.empty();
> {code}
> If rawOperatorState is null, closeableRegistry would be left unclosed.



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

Reply via email to