tillrohrmann commented on a change in pull request #12611:
URL: https://github.com/apache/flink/pull/12611#discussion_r438907989



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java
##########
@@ -538,36 +538,45 @@ private void 
startTriggeringCheckpoint(CheckpointTriggerRequest request) {
                                                                        
coordinatorsToCheckpoint, pendingCheckpoint, timer),
                                                        timer);
 
-                       CompletableFuture.allOf(masterStatesComplete, 
coordinatorCheckpointsComplete)
-                               .whenCompleteAsync(
-                                       (ignored, throwable) -> {
-                                               final PendingCheckpoint 
checkpoint =
-                                                       
FutureUtils.getWithoutException(pendingCheckpointCompletableFuture);
-
-                                               if (throwable == null && 
checkpoint != null && !checkpoint.isDiscarded()) {
-                                                       // no exception, no 
discarding, everything is OK
-                                                       final long checkpointId 
= checkpoint.getCheckpointId();
-                                                       snapshotTaskState(
-                                                               timestamp,
-                                                               checkpointId,
-                                                               
checkpoint.getCheckpointStorageLocation(),
-                                                               request.props,
-                                                               executions,
-                                                               
request.advanceToEndOfTime);
-
-                                                       
coordinatorsToCheckpoint.forEach((ctx) -> 
ctx.afterSourceBarrierInjection(checkpointId));
-
-                                                       onTriggerSuccess();
-                                               } else {
-                                                               // the 
initialization might not be finished yet
-                                                               if (checkpoint 
== null) {
-                                                                       
onTriggerFailure(request, throwable);
+                       FutureUtils.assertNoException(
+                               CompletableFuture.allOf(masterStatesComplete, 
coordinatorCheckpointsComplete)
+                                       .whenCompleteAsync(
+                                               (ignored, throwable) -> {
+                                                       final PendingCheckpoint 
checkpoint =
+                                                               
FutureUtils.getWithoutException(pendingCheckpointCompletableFuture);
+
+                                                       if (throwable == null 
&& checkpoint != null) {
+                                                               if 
(checkpoint.isDiscarded()) {
+                                                                       
onTriggerFailure(
+                                                                               
checkpoint,
+                                                                               
new CheckpointException(
+                                                                               
        CheckpointFailureReason.TRIGGER_CHECKPOINT_FAILURE,
+                                                                               
        checkpoint.getFailureCause()));
                                                                } else {
-                                                                       
onTriggerFailure(checkpoint, throwable);
+                                                                       // no 
exception, no discarding, everything is OK
+                                                                       final 
long checkpointId = checkpoint.getCheckpointId();
+                                                                       
snapshotTaskState(
+                                                                               
timestamp,
+                                                                               
checkpointId,
+                                                                               
checkpoint.getCheckpointStorageLocation(),
+                                                                               
request.props,
+                                                                               
executions,
+                                                                               
request.advanceToEndOfTime);
+
+                                                                       
coordinatorsToCheckpoint.forEach((ctx) -> 
ctx.afterSourceBarrierInjection(checkpointId));
+
+                                                                       
onTriggerSuccess();
                                                                }
-                                               }
-                                       },
-                                       timer);
+                                                       } else {
+                                                                       // the 
initialization might not be finished yet
+                                                                       if 
(checkpoint == null) {
+                                                                               
onTriggerFailure(request, throwable);
+                                                                       } else {
+                                                                               
onTriggerFailure(checkpoint, throwable);

Review comment:
       I think we should exclude the case `throwable == null && checkpoint == 
null` by asserting that either of them needs to be non-zero. I will push a 
fixup.




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