Allow DBDagBag TTL cache eviction without a size cap - #69774
Conversation
379aa9e to
a112469
Compare
DBDagBag TTL cache eviction without a size cap
SameerMesiah97
left a comment
There was a problem hiding this comment.
Just one nit. Looks good otherwise.
Thanks for the review! Changes already implemented |
|
hi, may I know what airflow version would this be released to? |
5b5ca6c to
d65c199
Compare
vatsrahul1001
left a comment
There was a problem hiding this comment.
The DBDagBag fix itself looks right, but I don't think it's reachable from the actual config path yet. create_dag_bag() in api_fastapi/common/dagbag.py still does:
if cache_size <= 0:
return DBDagBag(cache_size=0)
That early-return fires whenever dag_cache_size <= 0 and never even reads cache_ttl_config, so setting dag_cache_size = 0 + dag_cache_ttl = 3600 in airflow.cfg still ends up as a plain unbounded dict with no eviction. test_create_dag_bag_cache_modes still asserts exactly that (the "size_zero_unbounded" case expects dict/_use_cache=False for cache_size=0, cache_ttl=3600), and config.yml's dag_cache_size description still says 0 means "unbounded dict, no eviction" with no mention of TTL-only mode.
Could you also update create_dag_bag() to pass cache_ttl through when cache_size<=0, add a case to test_create_dag_bag_cache_modes covering that combo, and touch up the config.yml wording? Otherwise this fix isn't actually reachable by anyone configuring it through airflow.cfg.
d65c199 to
bebd4df
Compare
45641ab to
68f1a7a
Compare
68f1a7a to
2432fa4
Compare
Thanks for the review. Changes already implemented :) |
|
LGTM!, can be merged after code owners review |
|
Moving to 3.3.2 as this is still pending code owner review and do not want to rush on merging this as it not critical |
No problem. In the meantime, I can work on some of the other items to fix #69001 |
Allow
DBDagBagTTL cache eviction without a size cap (i.e.cache_size=0,cache_ttl>0).Related to #69001 and #69007
Was generative AI tooling used to co-author this PR?
Claude Opus 4.8 to analyze the impact of this change in terms of docs/code.
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.