amoghrajesh commented on code in PR #66586:
URL: https://github.com/apache/airflow/pull/66586#discussion_r3224134810
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py:
##########
@@ -225,6 +226,17 @@ def patch_dag_run(
get_listener_manager().hook.on_dag_run_success(dag_run=dag_run, msg="")
except Exception:
log.exception("error calling listener")
+
+ # Clear state for all TIs in the run — not just the ones that
were transitioned.
+ # When a run is manually marked SUCCESS, the whole run is
considered done
+ # regardless of which TIs were already in SUCCESS.
+ all_tis = session.scalars(
+ select(TaskInstance).where(
+ TaskInstance.dag_id == dag_run.dag_id,
+ TaskInstance.run_id == dag_run.run_id,
+ )
+ ).all()
+ _clear_task_state_on_success(all_tis, session)
Review Comment:
Good points, converting the API to async seems to be a considerable effort.
For now I'll scope out the dag-run path from this PR and handle it in a
follow-up where we can properly address it after evaluating best options. With
that, I intend to cover core `clear_on_success` behavior via the execution API
and individual TI mark-as-success is covered in this PR. Follow up issue:
https://github.com/apache/airflow/issues/66755
--
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]