zhijiangW commented on a change in pull request #11515: [FLINK-16744][task] implement channel state persistence for unaligned checkpoints URL: https://github.com/apache/flink/pull/11515#discussion_r402437475
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java ########## @@ -914,6 +914,11 @@ private void closeNetworkResources() { LOG.error("Failed to release input gate for task {}.", taskNameWithSubtask, t); } } + try { + taskStateManager.close(); Review comment: The previous `closeNetworkResources` can be used in two scenarios, one is for task exit in finally region, another is used by canceler thread before task exiting. The motivation to close network resource by canceler thread is to release the buffers ASAP, then the task thread can cause exception while interacting with buffer to make it exit early. If the close of `taskStateManager` does not have the effect to make task thread exit early, then it should not be called by canceler thread, and it only needs to be called in task thread finally region. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services