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

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

Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5723#discussion_r175705138
  
    --- Diff: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/StreamTaskStateInitializerImpl.java
 ---
    @@ -279,15 +279,14 @@ protected OperatorStateBackend operatorStateBackend(
     
                if (restoreStateAlternatives.hasNext()) {
     
    -                   final CloseableRegistry closeableRegistry = new 
CloseableRegistry();
    -
                        Collection<OperatorStateHandle> rawOperatorState = 
restoreStateAlternatives.next();
                        // TODO currently this does not support local state 
recovery, so we expect there is only one handle.
                        Preconditions.checkState(
                                !restoreStateAlternatives.hasNext(),
                                "Local recovery is currently not implemented 
for raw operator state, but found state alternative.");
     
                        if (rawOperatorState != null) {
    +                           final CloseableRegistry closeableRegistry = new 
CloseableRegistry();
    --- End diff --
    
    Can't we even move this registry into the anonymous class?


> 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