kumar-mallikarjuna commented on code in PR #25027:
URL: https://github.com/apache/flink/pull/25027#discussion_r1741026602


##########
flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/DefaultJobManagerRunnerRegistry.java:
##########
@@ -83,9 +83,16 @@ public Collection<JobManagerRunner> getJobManagerRunners() {
     }
 
     @Override
-    public CompletableFuture<Void> localCleanupAsync(JobID jobId, Executor 
unusedExecutor) {
+    public CompletableFuture<Void> localCleanupAsync(
+            JobID jobId, Executor ignoredExecutor, Executor 
mainThreadExecutor) {
         if (isRegistered(jobId)) {
-            return unregister(jobId).closeAsync();
+            CompletableFuture<Void> resultFuture = 
this.jobManagerRunners.get(jobId).closeAsync();
+
+            return resultFuture.thenApplyAsync(
+                    result -> {
+                        mainThreadExecutor.execute(() -> unregister(jobId));
+                        return result;
+                    });

Review Comment:
   This might need to be slightly different since right now when this method is 
called, the result of the `closeAsync()`'s future is expected:
   
https://github.com/apache/flink/pull/25027/files#diff-780ffdbcb09b706ad230014f4b30772e393c67fdae253d9cf6a32adc188c5359R89-R95



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to