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



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java
##########
@@ -672,6 +644,64 @@ private void 
startTriggeringCheckpoint(CheckpointTriggerRequest request) {
         }
     }
 
+    private void triggerCheckpointRequest(
+            CheckpointTriggerRequest request, long timestamp, 
PendingCheckpoint checkpoint) {
+        if (checkpoint.isDisposed()) {
+            onTriggerFailure(
+                    checkpoint,
+                    new CheckpointException(
+                            CheckpointFailureReason.TRIGGER_CHECKPOINT_FAILURE,
+                            checkpoint.getFailureCause()));
+        } else {
+            triggerTasks(request, timestamp, checkpoint)
+                    .exceptionally(
+                            failure -> {
+                                onTriggerFailure(
+                                        checkpoint,
+                                        new CheckpointException(
+                                                
CheckpointFailureReason.TRIGGER_CHECKPOINT_FAILURE,
+                                                failure));
+                                return null;
+                            });
+
+            coordinatorsToCheckpoint.forEach(
+                    (ctx) -> 
ctx.afterSourceBarrierInjection(checkpoint.getCheckpointID()));
+            // It is possible that the tasks has finished
+            // checkpointing at this point.
+            // So we need to complete this pending checkpoint.
+            if (maybeCompleteCheckpoint(checkpoint)) {
+                onTriggerSuccess();

Review comment:
       I think the name and comment of this method might have some misleadings 
in that it also return `true` if the checkpoint is not done yet, and it only 
returns false if it found that the checkpoint could not complete in the future~ 
 




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to