eladkal commented on code in PR #31840:
URL: https://github.com/apache/airflow/pull/31840#discussion_r1228593439


##########
docs/apache-airflow/authoring-and-scheduling/deferring.rst:
##########
@@ -166,3 +166,13 @@ Airflow tries to only run triggers in one place at once, 
and maintains a heartbe
 This means it's possible, but unlikely, for triggers to run in multiple places 
at once; this is designed into the Trigger contract, however, and entirely 
expected. Airflow will de-duplicate events fired when a trigger is running in 
multiple places simultaneously, so this process should be transparent to your 
Operators.
 
 Note that every extra ``triggerer`` you run will result in an extra persistent 
connection to your database.
+
+
+Difference between Mode='reschedule' and Deferrable=True in Sensors
+-------------------------------------------------------------------
+
+In Airflow, Sensors wait for specific conditions to be met before proceeding 
with downstream tasks. Sensors have two options for managing idle periods: 
mode='reschedule' and deferrable=True.
+
+* Mode='reschedule': The sensor continuously reschedules itself until the 
condition is met or the maximum retries are reached, suitable for conditions 
expected to change    over time.Resource consumption may be higher as the 
sensor is repeatedly executed.
+
+* Deferrable=True: The sensor pauses execution when idle, freeing up worker 
slots for other tasks, ideal for sensors waiting for external events or 
resources. Requires proper implementation of deferring logic and coordination 
with the event or resource.

Review Comment:
   Sensor with reschedule vs Deferrable Sensor
   if it makes sense.. I like to see comparison in tables 
   
   Note that the current paragraph that you wrote doesn't answer the most 
important question.
   I have both options. they were already implemented in Airflow. What do I use 
for my DAG?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to