Skip to content

Commit 5fc7142

Browse files
committed
k8s executor - ensure pods cleaned up
This commit ensures that completed pods are eventually cleaned up.
1 parent 880f298 commit 5fc7142

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

airflow/providers/cncf/kubernetes/executors/kubernetes_executor.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,13 @@ def start(self) -> None:
305305
self.kube_config.worker_pods_queued_check_interval,
306306
self.clear_not_launched_queued_tasks,
307307
)
308+
309+
self.event_scheduler.call_regular_interval(
310+
conf.getfloat("scheduler", "orphaned_tasks_check_interval", fallback=300.0),
311+
self._adopt_completed_pods,
312+
(self.kube_client,),
313+
)
314+
308315
# We also call this at startup as that's the most likely time to see
309316
# stuck queued tasks
310317
self.clear_not_launched_queued_tasks()

0 commit comments

Comments
 (0)