-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Manually marking dag run state will change end date #31555
Comments
While setting task state the task's existing end_date is checked. Meanwhile for dagrun it seems the check is not done and it seems intentional and given the commit has tests it might be breaking backwards compatibility. airflow/airflow/models/taskinstance.py Lines 934 to 936 in a8c45b0
commit b4f1c73
|
Came across this one when testing 2.7.0rc1 This bug can also easily mess metrics collectors. |
I just tried to fix this. airflow/airflow/api/common/mark_tasks.py Lines 360 to 369 in 270e219
perhaps someone could pick this up from my clue maybe. Maybe the code below would work after one could resolve the above problem. I suspect the problem comes from the if state == DagRunState.RUNNING:
dag_run.start_date = timezone.utcnow()
dag_run.end_date = None
elif state == DagRunState.QUEUE:
dag_run.end_date = timezone.utcnow()
session.merge(dagrun) |
Apache Airflow version
main (development)
What happened
When manually marking a dag run as success or failure, the end date of the run will also change. This is most noticable in the grid view since the duration will immediately change.
This has been the case for a while.
What you think should happen instead
We probably shouldn't alter the end_date.
How to reproduce
Manually mark a dag run, especially an old one, and see the dag run duration bar charts change dramatically with one outlier, ruining the value of the rest of the chart.
Operating System
any
Versions of Apache Airflow Providers
No response
Deployment
Official Apache Airflow Helm Chart
Deployment details
No response
Anything else
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: