Skip to content

Commit 9cf09fd

Browse files
YingboWangkaxil
authored andcommitted
[AIRFLOW-2951] Update dag_run table end_date when state change (#3798)
The existing airflow only change dag_run table end_date value when a user teminate a dag in web UI. The end_date will not be updated if airflow detected a dag finished and updated its state. This commit add end_date update in DagRun's set_state function to make up tho problem mentioned above.
1 parent 86fd1c9 commit 9cf09fd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

airflow/api/common/experimental/mark_tasks.py

+1
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ def _set_dag_run_state(dag_id, execution_date, state, session=None):
208208
dr.state = state
209209
if state == State.RUNNING:
210210
dr.start_date = timezone.utcnow()
211+
dr.end_date = None
211212
else:
212213
dr.end_date = timezone.utcnow()
213214
session.commit()

0 commit comments

Comments
 (0)