pnowojski commented on a change in pull request #16589:
URL: https://github.com/apache/flink/pull/16589#discussion_r681192413



##########
File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/MultipleInputStreamTask.java
##########
@@ -195,6 +195,22 @@ protected void createInputProcessor(
         // EndOfPartitionEvent, we would not complement barriers for the
         // unfinished network inputs, and the checkpoint would be triggered
         // after received all the EndOfPartitionEvent.
+        if (options.getCheckpointType().shouldDrain()) {
+            CompletableFuture<Void> sourcesStopped =
+                    FutureUtils.waitForAll(
+                            operatorChain.getSourceTaskInputs().stream()
+                                    .map(s -> s.getOperator().stop())
+                                    .collect(Collectors.toList()));
+
+            return sourcesStopped.thenCompose(
+                    ignore -> triggerSourcesCheckpointInMailbox(metadata, 
options));

Review comment:
       Yes & no. Task doesn't wait on the `CompletableFuture` returned from 
`triggerCheckpointAsync` the. As far as I remember the future is used currently 
only in tests (it has been used long time ago in production code as well I 
think), but we kind of stuck with it because we didn't know how to refactor 
tests to not use it (I'm open to discussions to get rid of this effectively 
test only code).
   
   But that's kind of beside the point here, because the production code is 
ignoring if the future fails or not.




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