Myasuka commented on a change in pull request #8693:
URL: https://github.com/apache/flink/pull/8693#discussion_r424899752



##########
File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java
##########
@@ -182,7 +181,7 @@
        protected final TimerService timerService;
 
        /** The currently active background materialization threads. */
-       private final CloseableRegistry cancelables = new CloseableRegistry();
+       private final AsyncCheckpointRunnableRegistry cancelables = new 
AsyncCheckpointRunnableRegistry();

Review comment:
       Because `asyncCheckpointRunnable` is registered to `closeableRegistry` 
when it begins to run asynchronously, we have to introduce something to wrap 
the `checkpointId`, `AsyncCheckpointRunnable` and `closeableRegistry` to let 
cancellation available, which is the role `AsyncCheckpointRunnableRegistry` 
played. Even we move `Map<Long, AsyncCheckpointRunnable> checkpoints` from 
`AsyncCheckpointRunnableRegistry` to `SubtaskCheckpointCoordinatorImpl`, we 
still need something to warp them all.
   
   Moreover, since we register the `closeableRegistry` within 
`AsyncCheckpointRunnable`, and we create the runnable in 
`SubtaskCheckpointCoordinatorImpl`, I'm afraid it's not easy to avoid passing 
registry to `SubtaskCheckpointCoordinatorImpl`.




----------------------------------------------------------------
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]


Reply via email to