liveBook · Manning

Poke mode

As explained in Data Pipelines with Apache Airflow, Second Edition

Poke mode is a sensor execution mode in which the sensor retains its task slot while waiting between condition checks.

Poke mode keeps a sensor in its task slot while it repeatedly checks whether an external condition is true. This is useful for waiting on data, but prolonged polling can consume available task capacity. section 7.1.2

Waiting for supermarket data

A daily workflow checks whether each supermarket has delivered its data. If several deliveries are missing, poke-mode sensors continue polling and occupy task slots across successive DAG runs. The resulting buildup can block unrelated tasks. section 7.1.2

Manage the operational cost of polling by:

  • Setting a timeout so a sensor eventually fails instead of waiting indefinitely. section 7.1.2
  • Limiting concurrent DAG tasks with max_active_tasks when sensor activity could exhaust capacity. section 7.1.2
  • Considering mode="reschedule" when sensors should release their slot between checks. section 7.1.2
Figure 7.8 Sensor deadlock: all the running tasks are sensors waiting for a condition to be True, which never happens; thus, they occupy all slots.

Shows how sensors waiting for a never-true condition can occupy all available task slots. section 7.1.2

How Data Pipelines with Apache Airflow, Second Edition covers it

How deep it goes
Explains slot occupancy, timeout behavior, concurrency buildup, and reschedule alternatives, without detailing sensor implementation internals.
Examples
Uses missing supermarket deliveries, repeated file checks, and a sensor deadlock that fills available task slots.
What you can do after
Operate sensors with timeouts and concurrency limits, and evaluate reschedule mode when polling threatens task capacity.
How it connects
Connects sensors with task slots, timeouts, DAG scheduling, concurrency limits, and deferrable operators.

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.