amoghrajesh commented on code in PR #66463:
URL: https://github.com/apache/airflow/pull/66463#discussion_r3196104464
##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -3047,6 +3054,19 @@ def _remove_unreferenced_triggers(self, *, session:
Session = NEW_SESSION) -> No
.execution_options(synchronize_session="fetch")
)
+ def _cleanup_expired_task_state(self) -> None:
+ """
+ Remove expired task state rows and orphaned asset state rows.
+
+ Reads ``[state_store] default_retention_days`` from config and
delegates to the
+ configured state backend. Runs on the interval set by ``[state_store]
state_cleanup_interval``.
+ """
+ retention_days = conf.getint("state_store", "default_retention_days")
Review Comment:
Oops, fixed it! `retention_days=0` now disables time based cleanup entirely.
Refactored so `MetastoreStateBackend.cleanup()` reads `default_retention_days`
from config directly rather than receiving it as an argument, felt cleaner
since the backend is responsible for enforcing its own retention policy.
Scheduler just calls cleanup() with no args.
--
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]