amoghrajesh commented on code in PR #66586:
URL: https://github.com/apache/airflow/pull/66586#discussion_r3224156936
##########
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:
Deferring for now, reverted in fde2331426 and will handle in
https://github.com/apache/airflow/issues/66755
##########
task-sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -1431,6 +1431,10 @@ def _handle_current_task_success(
task_outlets = list(_build_asset_profiles(ti.task.outlets))
outlet_events = list(_serialize_outlet_events(context["outlet_events"]))
+
+ if conf.getboolean("state_store", "clear_on_success"):
+ log.warning("Task state will be cleared by the server because
clear_on_success is enabled.")
Review Comment:
Sure, handled in 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]