[
https://issues.apache.org/jira/browse/FLINK-9019?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16405049#comment-16405049
]
Sihua Zhou commented on FLINK-9019:
-----------------------------------
I think we can't use try-with-resources here, cause {{closeableRegistry}} will
be wrapped by an anonymous class as the return value of
`rawOperatorStateInputs()`. But I agree that closing a empty
{{closeableRegistry}} here could make code more safer.
> 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)