XComp commented on a change in pull request #18536:
URL: https://github.com/apache/flink/pull/18536#discussion_r798446123



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/Dispatcher.java
##########
@@ -571,9 +525,11 @@ private void runJob(JobGraph jobGraph, ExecutionType 
executionType) throws Excep
                                 getMainThreadExecutor());
 
         final CompletableFuture<Void> jobTerminationFuture =
-                cleanupJobStateFuture
-                        .thenApply(cleanupJobState -> removeJob(jobId, 
cleanupJobState))
-                        .thenCompose(Function.identity());
+                cleanupJobStateFuture.thenCompose(
+                        cleanupJobState -> {
+                            
getMainThreadExecutor().assertRunningInMainThread();

Review comment:
       true, I also remove it from `Dispatcher.globalCleanup(JobID)` where it's 
also not really necessary. I will leave it in for 
`Dispatcher.localCleanup(JobID)`, though, because it's a requirement for the 
`DefaultResourceCleaner.cleanupAsync(JobID)` and having that assert makes it 
more explicit.




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