1fanwang commented on code in PR #59066:
URL: https://github.com/apache/airflow/pull/59066#discussion_r2590372623


##########
airflow-core/src/airflow/models/taskinstance.py:
##########
@@ -304,6 +304,7 @@ def clear_task_instances(
                     dr.last_scheduling_decision = None
                     dr.start_date = None
                     dr.clear_number += 1
+                    dr.queued_at = timezone.utcnow()

Review Comment:
   quick question on the assignment just for my learning
   
   theoretically:
   
https://github.com/apache/airflow/blob/cd255d7bffe2749f0af76cdc1dc85dc7822bc348/airflow-core/src/airflow/models/taskinstance.py#L282
   This line assigns the state to the DagRun object.
   
   the state property
   
https://github.com/apache/airflow/blob/cd255d7bffe2749f0af76cdc1dc85dc7822bc348/airflow-core/src/airflow/models/dagrun.py#L537-L539
   This uses SQLAlchemy's synonym() with a Python property descriptor. 
Assigning to dr.state would call the set_state() method.
   
   the setter logic here
   
https://github.com/apache/airflow/blob/cd255d7bffe2749f0af76cdc1dc85dc7822bc348/airflow-core/src/airflow/models/dagrun.py#L518-L522
   Already sets queued_at here
   Since we're transitioning from finished states (SUCCESS/FAILED) to QUEUED, 
the condition self._state != state is TRUE, so queued_at "should" be set
   
   just curious how this is not working as expected in practice, how was this 
bug discovered? was queued_at remaining NULL or keeping an old timestamp after 
clearing?



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