Skip to content

Commit c55fa9a

Browse files
committed
address review comments on dag cache docs and add improvement newsfragment
1 parent 2432fa4 commit c55fa9a

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

airflow-core/docs/faq.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ in memory. Configure this in the ``[api]`` section:
728728
dag_cache_size = 64 ; max cached versions (0 = no size cap, TTL still applies)
729729
dag_cache_ttl = 3600 ; seconds before a cached entry expires (0 = LRU only)
730730
731-
Setting both to 0 disables eviction entirely, matching pre-3.2 behavior.
731+
Setting both to 0 disables eviction entirely, matching pre-3.3 behavior.
732732

733733
The cache is keyed by Dag version ID. After a Dag is updated, the API server may serve the
734734
previous version until the cached entry expires (controlled by ``dag_cache_ttl``).
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
``[api] dag_cache_ttl`` is now honored when ``[api] dag_cache_size = 0``, giving the API server TTL-based eviction of cached serialized Dags with no size cap. Previously ``dag_cache_size = 0`` disabled eviction entirely and silently ignored ``dag_cache_ttl``. To keep the previous fully-unbounded behavior, set ``dag_cache_ttl = 0`` as well.

airflow-core/src/airflow/config_templates/config.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1705,7 +1705,10 @@ api:
17051705
description: |
17061706
Size of the LRU cache for SerializedDAG objects in the API server.
17071707
Set to 0 to remove the size cap. Cached entries are then evicted only by
1708-
``dag_cache_ttl``, or never if that is also 0 (matching pre-3.2 behavior).
1708+
``dag_cache_ttl``, or never if that is also 0 (matching pre-3.3 behavior).
1709+
Note that the TTL is then not a ceiling on memory. Entries that keep being
1710+
requested are refreshed and never expire, so memory usage follows the number
1711+
of distinct Dag versions in active use.
17091712
The cache is keyed by Dag version ID, so lookups by Dag ID
17101713
(e.g., viewing a Dag's details) always query the database for the latest
17111714
version, but the deserialized result is cached for subsequent

0 commit comments

Comments
 (0)