uranusjr commented on code in PR #71816:
URL: https://github.com/apache/airflow/pull/71816#discussion_r3954406612
##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -301,6 +290,30 @@ def _is_parent_process() -> bool:
return multiprocessing.current_process().name == "MainProcess"
+def _create_scheduler_dag_bag() -> CachedDBDagBag:
+ """
+ Build the scheduler's DagBag from the ``[scheduler]`` cache options.
+
+ Defaults to an LRU cache of 512 versions with no TTL. A size limit is the
only hard ceiling:
+ each re-check resets an entry's expiry, so a TTL reclaims a version only
once its runs finish
+ and it stops being requested, bounding memory by the concurrently active
set rather than
+ outright. With both limits disabled, retain loaded Dags without eviction
for the process
+ lifetime.
+ """
+ cache_size = conf.getint("scheduler", "dag_cache_size", fallback=512)
+ cache_ttl = conf.getint("scheduler", "dag_cache_ttl", fallback=0)
Review Comment:
These fallbacks shouldn’t be needed since `config.yml` already specifies
defaults.
--
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]