huwh commented on code in PR #22311: URL: https://github.com/apache/flink/pull/22311#discussion_r1153988699
########## flink-kubernetes/src/main/java/org/apache/flink/kubernetes/KubernetesResourceManagerDriver.java: ########## @@ -65,6 +67,11 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.CompletableFuture; +import static io.fabric8.kubernetes.client.Watcher.Action.ADDED; Review Comment: It's better not use fabric classes in KubernetesResourceManagerDriver since these are Flink internal logic. ########## flink-kubernetes/src/main/java/org/apache/flink/kubernetes/KubernetesResourceManagerDriver.java: ########## @@ -340,12 +347,12 @@ private KubernetesTaskManagerParameters createKubernetesTaskManagerParameters( blockedNodes); } - private void handlePodEventsInMainThread(List<KubernetesPod> pods) { + private void handlePodEventsInMainThread(List<KubernetesPod> pods, Action action) { getMainThreadExecutor() .execute( () -> { for (KubernetesPod pod : pods) { - if (pod.isTerminated()) { + if (action == DELETED || pod.isTerminated()) { Review Comment: We need some annotations to explain why we need this logic. -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org