gaoyunhaii commented on a change in pull request #14740:
URL: https://github.com/apache/flink/pull/14740#discussion_r578879271



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java
##########
@@ -651,39 +681,52 @@ private void 
startTriggeringCheckpoint(CheckpointTriggerRequest request) {
         }
     }
 
+    private CompletableFuture<CheckpointPlan> calculateCheckpointPlan() {
+        return checkpointPlanCalculator
+                .calculateCheckpointPlan()
+                // Disable checkpoints after tasks finished according to the 
flag.
+                .thenApplyAsync(
+                        plan -> {
+                            if (!allowCheckpointsAfterTasksFinished
+                                    && !plan.getFinishedTasks().isEmpty()) {
+                                throw new CompletionException(

Review comment:
       I also think move the check before computing would be more reasonable. I 
have modified accordingly. For the long run, we would remove the judgement 
after we enabled the whole functionality~




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


Reply via email to