You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/12/28 09:36:58 UTC

[GitHub] [airflow] wenjun93 commented on a change in pull request #20438: Cleanup pending pods

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

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