You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "huwh (via GitHub)" <gi...@apache.org> on 2023/03/31 04:51:34 UTC

[GitHub] [flink] huwh commented on a diff in pull request #22311: [FLINK-31652][k8s] Handle the deleted event in case pod is deleted during the pending phase

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-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org