dimonchik-suvorov commented on code in PR #30125:
URL: https://github.com/apache/airflow/pull/30125#discussion_r1138778401
##########
airflow/models/taskinstance.py:
##########
@@ -299,11 +299,14 @@ def clear_task_instances(
)
dag_run_state = DagRunState(dag_run_state) # Validate the state value.
for dr in drs:
- dr.state = dag_run_state
- dr.start_date = timezone.utcnow()
- if dag_run_state == DagRunState.QUEUED:
- dr.last_scheduling_decision = None
- dr.start_date = None
+ # Otherwise task(s) cleared in the middle of the running DagRun.
+ # There is no need to reset anything
+ if dr.state in [State.SUCCESS, State.FAILED]:
+ dr.state = dag_run_state
+ dr.start_date = timezone.utcnow()
+ if dag_run_state == DagRunState.QUEUED:
Review Comment:
> This code will never be reached
Why not?
> it'll cause a lot of confusion for the scheduler and users
it is causing confusion for our users when start_date isn't actual initial
start_date. And regarding scheduler - I've tested that on my local Airflow and
it works. Could you please be more specific about how exactly it will break
something?
--
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]