azagrebin commented on a change in pull request #6777: [FLINK-10461] [State Backends, Checkpointing] Speed up download files when restore from DFS URL: https://github.com/apache/flink/pull/6777#discussion_r223032334
########## File path: flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBKeyedStateBackend.java ########## @@ -1286,10 +1289,38 @@ private void transferAllDataFromStateHandles( Map<StateHandleID, StreamStateHandle> stateHandleMap, Path restoreInstancePath) throws IOException { + ExecutorService executorService = Executors.newFixedThreadPool(5); Review comment: Cancelation of `copyStateDataHandleData` futures and `executorService.shutdownNow()` should be registered in `cancelStreamRegistry.registerCloseable()` and unregistered with `unregisterCloseable` before `executorService.shutdown()` in `finally`. Similar to streams in `copyStateDataHandleData`. This way we guarantee freeing of all resources in case of job abrupt shutdown. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services