StefanRRichter commented on a change in pull request #7568: [FLINK-11417] Make 
access to ExecutionGraph single threaded from JobMaster main thread
URL: https://github.com/apache/flink/pull/7568#discussion_r250976209
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/failover/FailoverRegion.java
 ##########
 @@ -152,10 +160,16 @@ private void cancel(final long 
globalModVersionOfFailover) {
                                        }
 
                                        final FutureUtils.ConjunctFuture<Void> 
allTerminal = FutureUtils.waitForAll(futures);
-                                       allTerminal.thenAcceptAsync(
-                                               (Void value) -> 
allVerticesInTerminalState(globalModVersionOfFailover),
-                                               executor);
-
+                                       final Consumer<Void> recoveryAction =
+                                               (Void value) -> 
allVerticesInTerminalState(globalModVersionOfFailover);
+
+                                       if (testExecutor == null) {
+                                               // branch for production code.
+                                               
allTerminal.thenAccept(recoveryAction);
+                                       } else {
+                                               // this branch should only be 
taken for some unit tests.
+                                               
allTerminal.thenAcceptAsync(recoveryAction, testExecutor);
 
 Review comment:
   Alternatively, we could also generally pass in the excutor, in the 
production code the main thread executor. However, this would require to change 
at what time the failover strategy is created, because right now, the executor 
is passed in in `start(...)` which happens after the failover stratey is 
created.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to