Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4220#discussion_r125165262
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/restart/ExecutionGraphRestarter.java
 ---
    @@ -42,4 +48,23 @@ public Object call() throws Exception {
                        }
                };
        }
    -}
    \ No newline at end of file
    +
    +   public static void scheduleRestartWithDelay(final ExecutionGraph 
executionGraph, final long delayBetweenRestartAttemptsInMillis,
    +                                                                           
                final ScheduledExecutorService executorService) {
    +           ScheduledFuture<Object> future = executorService.schedule(
    +                   new Callable<Object>() {
    +                           @Override
    +                           public Object call() throws Exception {
    +                                   executionGraph.restart();
    +                                   return null;
    +                           }
    +                   }, delayBetweenRestartAttemptsInMillis, 
TimeUnit.MILLISECONDS
    +           );
    +
    +           try {
    +                   future.get();
    --- End diff --
    
    This `get()` operation voids the idea of the executor service because it 
blocks the calling thread.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to