carp84 commented on a change in pull request #7866: [FLINK-11730] [State 
Backends] Make HeapKeyedStateBackend follow the builder pattern
URL: https://github.com/apache/flink/pull/7866#discussion_r262044916
 
 

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/StreamTaskStateInitializerImpl.java
 ##########
 @@ -266,6 +266,11 @@ protected OperatorStateBackend operatorStateBackend(
                        taskInfo.getNumberOfParallelSubtasks(),
                        taskInfo.getIndexOfThisSubtask());
 
+               // Now restore processing is included in backend 
building/constructing process, so we need to make sure
+               // each stream constructed in restore could also be closed in 
case of task cancel, for example the data
+               // input stream opened for serDe during restore.
+               CloseableRegistry cancelStreamRegistry = new 
CloseableRegistry();
+               
backendCloseableRegistry.registerCloseable(cancelStreamRegistry);
 
 Review comment:
   Will follow the former way with two registries since it shows the semantic 
clearly.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to