hussein-awala commented on issue #30642:
URL: https://github.com/apache/airflow/issues/30642#issuecomment-1509618345

   Let me explain what happens when you clear a task:
   If you have two tasks in your dag: `t1 --> t2`
   When the first task succeeds but the second fails,  the run state will be 
failed and you will have something like:
   ```
   t1 -> (instant 1, instant 2), state success
   t2 -> (instant 3, instant 4), state failed
   dag run -> (start < instant 1, end > instant 4), state failed
   ```
   
   When you clear the task t2, we reset the state and the dates of t2 and the 
dag run, then when they finishes, will have something like:
   ```
   t1 -> (instant 1, instant 2),  state success
   t2 -> (None, None),  state None
   dag run -> ( start > run first end, None), queued
   ```
   Then when it finishes:
   ```
   t1 -> (instant 1, instant 2),  state success
   t2 -> (t5 > run first end, t6),  state success
   dag run -> ( run first end < start < t5, end > t6), success
   ```
   The run duration is the duration between the start and the end of the 
DagRun, if we don't reset the start date, the run duration will not be correct, 
and that affects a lot of things like the DagRun timeout.
   
   We can discuss the possibility to add a new column to store the first 
start_date if there is a real use case, but as a new feature and not a bug fix.


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