dawidwys commented on a change in pull request #14857:
URL: https://github.com/apache/flink/pull/14857#discussion_r665311913



##########
File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SubtaskCheckpointCoordinatorImpl.java
##########
@@ -406,6 +406,31 @@ public void initInputsCheckpoint(long id, 
CheckpointOptions checkpointOptions)
         }
     }
 
+    public void waitForPendingCheckpoints() throws Exception {
+        if (!enableCheckpointAfterTasksFinished) {
+            return;
+        }
+
+        List<AsyncCheckpointRunnable> asyncCheckpointRunnables;
+        synchronized (lock) {
+            asyncCheckpointRunnables = new ArrayList<>(checkpoints.values());
+        }
+
+        // Waits for each checkpoint independently.
+        asyncCheckpointRunnables.forEach(
+                ar -> {
+                    try {
+                        ar.getFinishedFuture().get();
+                    } catch (Exception e) {
+                        LOG.error(

Review comment:
       I get the original intention, but to implement that we need changes in 
the `AsyncCheckpointRunnable`, don't we? Currently the `getFinishedFuture` 
never finishes exceptionally. We only ever call `finishedFuture.complete(null)` 
in the `AsyncCheckpointRunnable`. The only exception can appear from 
interrupting the thread that is calling the `waitForPendingCheckpoints`. Or am 
I wrong?




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