StephanEwen commented on a change in pull request #15605: URL: https://github.com/apache/flink/pull/15605#discussion_r613250346
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/operators/coordination/SubtaskGatewayImpl.java ########## @@ -64,6 +69,17 @@ subtaskAccess.createEventSendAction(serializedEvent); final CompletableFuture<Acknowledge> result = new CompletableFuture<>(); + result.whenCompleteAsync( Review comment: Which checkpoint the events are attributed to, and which gateway they target is independent, that is a nice part in the design. Here we only need to care about the checkpoint, which means that we need to obtain these pending futures in the same atomic operation as we close the event valve (which is analogous to the point of injecting the checkpoint barrier). All events before the valve shuts are tracked, no events after the valve are tracked. The event sending action is enqueued in the main thread executor, same as the valve-closing-action, so the events that are sent later cannot overtake that action. What gateway the events target is not important here. They may very well target an outdated gateway, in which case they will fail immediately (as soon as the `Execution` is in a terminal state, or the RPC Ask-Timeout fires. -- 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