[v3-3-test] Honor the API server Dag cache TTL when no size limit is set (#71814) - #71845
Open
jason810496 wants to merge 1 commit into
Open
[v3-3-test] Honor the API server Dag cache TTL when no size limit is set (#71814)#71845jason810496 wants to merge 1 commit into
jason810496 wants to merge 1 commit into
Conversation
…set (apache#71814) * Honor the API server Dag cache TTL when no size limit is set `[api] dag_cache_size = 0` reads as "no size limit", but it selected a mapping that never evicted at all and silently ignored `[api] dag_cache_ttl`. Age-based eviction could therefore only be enabled by also accepting a size cap, which is backwards for a deployment that wants to bound staleness rather than count. A TTL now applies with or without a size limit, and only setting both options to 0 disables eviction. Deployments on `dag_cache_size = 0` start evicting on the default hour-long TTL; setting `dag_cache_ttl = 0` restores the old behaviour. The options were also documented as added in 3.3.0. They shipped in 3.2.2. * Reject negative API Dag cache values and clarify TTL behavior Negative cache configuration should fail fast, and operator guidance must reflect that TTL refreshes happen only at revalidation boundaries. * Reject negative cache values for every DBDagBag caller Validating at the shared boundary prevents non-API callers from silently clamping invalid cache settings. * Clarify cache validation context and docs wording Context-specific errors help operators identify invalid API settings, while defensive constructor checks protect other callers and documentation remains compatible with the spellchecker. * Clarify API cache TTL documentation layout (cherry picked from commit f63d321) Co-authored-by: Jason(Zhe-You) Liu <68415893+jason810496@users.noreply.github.com>
jason810496
requested review from
XD-DENG,
ashb,
bugraoz93,
choo121600,
ephraimbuddy,
henry3260,
pierrejeambrun,
rawwar and
shubhamraj-git
as code owners
August 19, 2026 15:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Setting
[api] dag_cache_size = 0was meant to mean "no size limit," but it silently disabled TTL-based eviction too, ignoringdag_cache_ttlentirely.Now the TTL applies regardless of size limit, and eviction is only fully disabled when both
dag_cache_sizeanddag_cache_ttlare 0. Deployments usingdag_cache_size = 0will start evicting on the default one-hour TTL; setdag_cache_ttl = 0to keep the old behavior.Also included:
dag_cache_size/dag_cache_ttlvalues now raise aValueErrorinstead of being silently clamped (validated both at the API config boundary and defensively inDBDagBag)(cherry picked from commit f63d321)