Open eladkal opened 4 months ago
https://forum.astronomer.io/t/dag-run-marked-as-success-but-no-tasks-even-started/1423 https://stackoverflow.com/q/73652663
We usually have users using dynamic start_date which causes the issue. We point them to these links. It will be helpful if these dagruns are blocked from marked as success.
Dynamic start date is wrong usage. The case that I show here is valid.
@eladkal I want to try my hand at this one, seems interesting. Can I take it up?
Sure. Assigned @amoghrajesh
@amoghrajesh have you been able to figure out what is causing this?
regarding the note about the tasks running if you deploy the dag with a past start_date and change it to a future start_date, it will run the tasks properly for a while but then revert to the old behaviour after manually triggering the dag a few times
side note: same issue behaviour when manual run is triggered after end_date
Body
For the following DAG:
As expected no runs will be started till 2050 but I might still want to manually invoke runs. Trying to do so will result in DAGRun marked as success and no tasks being executed as can see
However changing the![Screenshot 2024-03-26 at 22 24 28](https://github.com/apache/airflow/assets/45845474/32369453-2036-4e92-ab77-a7ee9ec1b260)
start_date
todatetime(2023, 1, 1)
then tasks are executed as expected for manual runs:The bug: tasks should be executed for manual runs. The current case where dagrun is marked as success but no tasks are running or reporting failure is wrong.
By the way, a very interesting thing to explore is that if you first deploy the dag with
datetime(2023, 1, 1)
then change it todatetime(2050, 1, 1)
Airflow has no problem with running tasks with thatstart_date
:Committer