ljz2051 commented on code in PR #24768: URL: https://github.com/apache/flink/pull/24768#discussion_r1604803348
########## flink-state-backends/flink-statebackend-forst/src/main/java/org/apache/flink/state/forst/ForStKeyedStateBackend.java: ########## @@ -147,15 +160,30 @@ public <SV, S extends State> S createState(@Nonnull StateDescriptor<SV> stateDes @Override @Nonnull public StateExecutor createStateExecutor() { - // TODO: Make io parallelism configurable - return new ForStStateExecutor(4, db, optionsContainer.getWriteOptions()); + synchronized (lock) { Review Comment: 1. I think `StateExecutor#shutdown` should be invoked **exactly once**. (The `CloseableRegistry` in `RocksDBKeyedStateBackend` has the similar semantics). 2. As for the semantics of `close` and `dispose`, StateBackend should call `close` method to close some dynamic threads and input/output streams first, then it can dispose some resources. So I think the more reasonable way is to shutdown the stateExecutors in `close` method, and force to close the `ForStKeyedStateBackend` in `dispose` method if the `ForStKeyedStateBackend` has not been closed yet. WDYT? -- 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. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org