akalash commented on a change in pull request #15375:
URL: https://github.com/apache/flink/pull/15375#discussion_r604751564
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java
##########
@@ -535,41 +545,82 @@ protected void beforeInvoke() throws Exception {
// -------- Invoke --------
LOG.debug("Invoking {}", getName());
+ SuspendableMailboxLoop suspendableLoop =
mailboxProcessor.getSuspendableLoop();
+
// we need to make sure that any triggers scheduled in open() cannot be
// executed before all operators are opened
- actionExecutor.runThrowing(
- () -> {
- SequentialChannelStateReader reader =
- getEnvironment()
- .getTaskStateManager()
- .getSequentialChannelStateReader();
- reader.readOutputData(
- getEnvironment().getAllWriters(),
- !configuration.isGraphContainingLoops());
-
- operatorChain.initializeStateAndOpenOperators(
- createStreamTaskStateInitializer());
-
- channelIOExecutor.execute(
- () -> {
- try {
-
reader.readInputData(getEnvironment().getAllInputGates());
- } catch (Exception e) {
- asyncExceptionHandler.handleAsyncException(
- "Unable to read channel state", e);
- }
- });
+ CompletableFuture<Void> allGatesRecoveredFuture =
+ actionExecutor.call(
+ () -> {
Review comment:
It is exactly what I want to do. In fact, I already did it in a separate
commit but I didn't push it yet.
--
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]