ephraimbuddy commented on code in PR #31274:
URL: https://github.com/apache/airflow/pull/31274#discussion_r1221046448


##########
airflow/executors/kubernetes_executor.py:
##########
@@ -217,8 +217,11 @@ def process_status(
         event: Any,
     ) -> None:
         """Process status response."""
+        pod = event["object"]
         if status == "Pending":
-            if event["type"] == "DELETED":
+            # deletion_timestamp is set by kube server when a graceful 
deletion is requested.
+            # since the pod is in intermediate state so set TI status failed
+            if pod.metadata.deletion_timestamp is not None:

Review Comment:
   ```suggestion
               if event["type"] == "DELETED" and 
pod.metadata.deletion_timestamp is not None:
   ```
   WDYT?



##########
airflow/executors/kubernetes_executor.py:
##########
@@ -246,7 +249,9 @@ def process_status(
             self.log.info("Event: %s Succeeded", pod_name)
             self.watcher_queue.put((pod_name, namespace, None, annotations, 
resource_version))
         elif status == "Running":
-            if event["type"] == "DELETED":
+            # deletion_timestamp is set by kube server when a graceful 
deletion is requested.
+            # since the pod is in intermediate state so set TI status failed
+            if pod.metadata.deletion_timestamp is not None:

Review Comment:
   ```suggestion
               if event["type"] == "DELETED" and 
pod.metadata.deletion_timestamp is not None:
   ```
   Not sure if the `is not None` is necessary



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