wolfier opened a new issue #15645:
URL: https://github.com/apache/airflow/issues/15645


   
   **Apache Airflow version**: 2.0.0
   
   **What happened**:
   
   Sensor start_date gets updated to each time the task instance is rescheduled 
for the same try.
   
   **What you expected to happen**:
   
   I expect the `start_date` of a sensor task instance to remain the same for 
each try. The `start_date` should be the start of first poke instead of the 
start time of the following rescheduled attempts. 
   
   This behaviour does not match the description in the [source 
code](https://github.com/apache/airflow/blob/2.0.0/airflow/models/taskinstance.py#L982-L983).
   
   >             # Set the task start date. In case it was re-scheduled use the 
initial
   >             # start date that is recorded in task_reschedule table
   
   Airflow did behave as expected in 1.10.x but it stopped in 2.0+.
   
   **How to reproduce it**:
   
   Run any sensors and watch the start_date value change at after each retry.
   
   ```python
   with DAG(
           dag_id="check_dag",
           start_date=datetime(2021, 1, 1),
           schedule_interval='@daily',
           catchup=False,
   ) as dag:
       p = ExternalTaskSensor(
           task_id='sensor_task',
           external_dag_id='my_dag',
           mode='reschedule'
       )
   ```


-- 
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.

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


Reply via email to