XComp commented on a change in pull request #18536:
URL: https://github.com/apache/flink/pull/18536#discussion_r798437837
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/Dispatcher.java
##########
@@ -937,16 +893,27 @@ private void registerJobManagerRunnerTerminationFuture(
private CompletableFuture<Void> removeJob(JobID jobId, CleanupJobState
cleanupJobState) {
switch (cleanupJobState) {
case LOCAL:
- return localResourceCleaner.cleanupAsync(jobId);
+ return localCleanup(jobId);
case GLOBAL:
- return globalResourceCleaner
- .cleanupAsync(jobId)
- .thenRun(() -> markJobAsClean(jobId));
+ return globalCleanup(jobId).thenRun(() ->
markJobAsClean(jobId));
default:
throw new IllegalStateException("Invalid cleanup state: " +
cleanupJobState);
}
}
+ private CompletableFuture<Void> globalCleanup(JobID jobId) {
+ 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]