Investigating the Many Loops of the Airflow Scheduler
summary
Trace of a task from creation to run through Airflow code shows a single critical section lock on the pool table that serializes which scheduler instance may queue tasks, a tricky Max TI per query vs parallelism tradeoff that makes tuning throughput and latency brittle, and a surprising priority model where priority_weight sums downstream nodes and can starve shallow DAGs. CeleryExecutor uses a process pool + apply_async and a bulk state fetcher; KubernetesExecutor batches pod creation (worker_pods_creation_batch_size) and relies on watcher queues to reconcile pod states.
AI-written summary · about
