wenjun93 commented on a change in pull request #20438:
URL: https://github.com/apache/airflow/pull/20438#discussion_r775813899



##########
File path: airflow/cli/commands/kubernetes_command.py
##########
@@ -108,11 +113,15 @@ def cleanup_pods(args):
             pod_phase = pod.status.phase.lower()
             pod_reason = pod.status.reason.lower() if pod.status.reason else ''
             pod_restart_policy = pod.spec.restart_policy.lower()
+            current_time = datetime.now(pod.metadata.creation_timestamp.tzinfo)
+            # set time limit to 30m for pending pods
+            max_pending_time = timedelta(minutes=30)

Review comment:
       @potiuk sure, addressed, PTAL. onething to remind is that I think we 
should cleanup old pending pods, otherwise we don't got a chance to do the 
deletion, as we have already filtered with labels, it's safe. And for newly 
pods, it might take time to be scheduled, so no cleanup action should be taken.




-- 
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: commits-unsubscr...@airflow.apache.org

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


Reply via email to