GJL commented on a change in pull request #9268: [FLINK-13452] Ensure to fail 
global when exception happens during reseting tasks of regions
URL: https://github.com/apache/flink/pull/9268#discussion_r310545689
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/failover/AdaptedRestartPipelinedRegionStrategyNG.java
 ##########
 @@ -108,13 +108,13 @@ protected void restartTasks(final Set<ExecutionVertexID> 
verticesToRestart) {
 
                FutureUtils.assertNoException(
                        cancelTasks(verticesToRestart)
-                               
.thenRunAsync(resetAndRescheduleTasks(globalModVersion, vertexVersions), 
executionGraph.getJobMasterMainThreadExecutor())
+                               .thenComposeAsync((ignored) -> 
resetAndRescheduleTasks(globalModVersion, vertexVersions), 
executionGraph.getJobMasterMainThreadExecutor())
                                .handle(failGlobalOnError()));
        }
 
-       private Runnable resetAndRescheduleTasks(final long globalModVersion, 
final Set<ExecutionVertexVersion> vertexVersions) {
+       private CompletableFuture<?> resetAndRescheduleTasks(final long 
globalModVersion, final Set<ExecutionVertexVersion> vertexVersions) {
 
 Review comment:
   I would return `Function<Object, CompletableFuture<Void>>` here so that we 
can write:
   
   ```
   FutureUtils.assertNoException(
                        cancelTasks(verticesToRestart)
                                
.thenComposeAsync(resetAndRescheduleTasks(globalModVersion, vertexVersions), 
executionGraph.getJobMasterMainThreadExecutor())
                                .handle(failGlobalOnError()));
   ```
   
   This is consistent with the style before.

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


With regards,
Apache Git Services

Reply via email to