Machine Learning

Dealing with "Zombie Tasks" in Apache Airflow running on Kubernetes?

ME Asked by Melissa Hughes · 15-08-2025
0 upvotes 6,007 views 0 comments
The question

We are running a heavy-duty ML pipeline on a Kubernetes cluster. Frequently, we see tasks that are marked as "success" in the logs but remain in a "running" state in the Apache Airflow UI until they eventually timeout as zombies. This is causing our resource pods to hang. Is this a heartbeat issue between the KubernetesExecutor and the scheduler, or something else entirely?

3 answers

0
RE
Answered on 17-08-2025

Zombie tasks usually occur when the Airflow scheduler loses track of a task that is still running on a worker, or if the process dies without updating the metadata DB. On Kubernetes, this often happens if your pods are being OOM-killed (Out of Memory) or if the scheduler_zombie_task_threshold is set too low for your cluster's network latency. Check your K8s events for "OOMKilled" status. If the pod disappears before it can send the final state to the DB, the scheduler will wait until the threshold is met before reaping it. Increasing the memory limits for your worker pods is the first step I'd take.

0
DO
Answered on 19-08-2025

Are you using any specific resource requests and limits in your pod_override configuration? It sounds like the scheduler and the worker pod are falling out of sync during long-running training jobs.

ME 20-08-2025

Douglas, yes, we are using pod_override to request GPUs. I noticed that when the model starts training, CPU usage on the pod spikes, which might be delaying the heartbeat signal back to the scheduler. Rebecca’s point about the zombie threshold also makes sense. We’ll try increasing the scheduler_health_check_threshold and ensuring the pod has a bit of CPU "headroom" so the heartbeat process doesn't get starved during the training phase.

0
JA
Answered on 21-08-2025

Check your database connection pool. If the workers can't write the "success" state because the DB is full or slow, the task will just hang in the UI indefinitely.

RE 22-08-2025

Solid advice from Jason. I’ve seen this happen with Postgres when the connection limit is reached. It makes the task look like a zombie when it’s actually just a DB bottleneck

Share your thoughts

Your email address will not be published. Required fields are marked (*)

Professional Counselling Session

Still have questions?
Schedule a free counselling session

Our experts are ready to help you with any questions about courses, admissions, or career paths. Get personalized guidance from industry professionals.

Request a Call Back

Search Online

We Accept

We Accept

Follow Us

"PMI®", "PMBOK®", "PMP®", "CAPM®" and "PMI-ACP®" are registered marks of the Project Management Institute, Inc. | "CSM", "CST" are Registered Trade Marks of The Scrum Alliance, USA. | COBIT® is a trademark of ISACA® registered in the United States and other countries.

Book Free Session