liveBook · Manning

Sensor deadlock

As explained in Data Pipelines with Apache Airflow, Second Edition

Sensor deadlock is a condition in which polling sensors exhaust available task capacity and prevent other tasks from running.

Sensor deadlock occurs when polling sensors consume all available task capacity, preventing other tasks from running. In a supermarket couponing workflow, repeatedly polling sensors accumulate until the DAG reaches its task limit; if the global limit is reached, the entire Airflow system can stall. section 7.1.2

A capacity snowball

With 16 concurrent task slots, three supermarkets polling each day consume 3, 6, 9, 12, and 15 slots over successive days. On day six, all 16 slots are occupied, so new tasks cannot run. section 7.1.2

Prevent or limit sensor deadlock by choosing how waiting tasks use capacity:

  • Use sensor mode="reschedule" so the sensor releases its slot after each poke and occupies capacity only while doing work. section 7.1.2
  • Use deferrable operators so idle work moves to the triggerer and worker slots remain available for other tasks. section 7.1.2
  • Control DAG or global concurrency limits, while recognizing that raising capacity alone does not remove inefficient polling. section 7.1.2

How Data Pipelines with Apache Airflow, Second Edition covers it

How deep it goes
Explains slot accumulation, poke versus reschedule behavior, deferral, and DAG or global concurrency controls.
Examples
Uses a supermarket couponing DAG whose polling sensors consume 16 concurrent task slots over six days.
What you can do after
Diagnose slot exhaustion and choose rescheduling, deferral, or concurrency configuration to keep other tasks running.
How it connects
Connects sensors with task slots, Airflow concurrency, reschedule mode, deferrable operators, and the triggerer.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Pipelines with Apache Airflow, Second Edition. The section links point to the parts of the book it draws on.