StefanRRichter 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_r262006927
##########
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:
This registry is never unregistered and can be closed twice now, once by
itself and as we pass it into the backend also through the backends
`close/dispose` methods. We could either work with two registries, once scoped
for the restore and once scoped for the backend object itself, or at least you
can unregister the registry once the restore is done, because the backend is
registered and `cancelStreamRegistry` is closed as part of the backend's
`close/dipose` now.
----------------------------------------------------------------
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