Repository navigation
Keep Dag parse results tied to their source snapshot - #74789
Merged
Merged
Conversation
1 task done
This was referenced Oct 15, 2026
ephraimbuddy
marked this pull request as ready for review
October 15, 2026 14:57
ephraimbuddy
requested review from
amoghrajesh,
ashb,
jedcunningham and
potiuk
as code owners
October 15, 2026 14:57
ephraimbuddy
force-pushed
the
dag-processor-source-consistency
branch
from
October 16, 2026 15:35
bffe26c to
81e0b40
Compare
ephraimbuddy
force-pushed
the
dag-processor-source-consistency
branch
from
October 20, 2026 10:56
445893d to
cfb451e
Compare
ephraimbuddy
force-pushed
the
dag-processor-source-consistency
branch
2 times, most recently
from
October 20, 2026 17:21
1f4ec6a to
9b7dfd8
Compare
kaxil
reviewed
Oct 21, 2026
uranusjr
reviewed
Oct 22, 2026
uranusjr
reviewed
Oct 22, 2026
uranusjr
reviewed
Oct 22, 2026
uranusjr
reviewed
Oct 22, 2026
uranusjr
reviewed
Oct 22, 2026
uranusjr
reviewed
Oct 22, 2026
ephraimbuddy
force-pushed
the
dag-processor-source-consistency
branch
from
October 22, 2026 16:58
9b7dfd8 to
562a387
Compare
ephraimbuddy
force-pushed
the
dag-processor-source-consistency
branch
3 times, most recently
from
October 26, 2026 15:19
49ece41 to
9e9ecf2
Compare
kaxil
reviewed
Oct 27, 2026
ephraimbuddy
force-pushed
the
dag-processor-source-consistency
branch
from
October 28, 2026 20:16
9e9ecf2 to
8e824a6
Compare
Contributor
|
The re-run of the jobs stopped by EC2 Spot interruptions finished: attempt 2 passed. |
ephraimbuddy
force-pushed
the
dag-processor-source-consistency
branch
from
October 29, 2026 16:55
8e824a6 to
ef49963
Compare
ephraimbuddy
force-pushed
the
dag-processor-source-consistency
branch
from
October 30, 2026 15:40
ef49963 to
56b6f88
Compare
potiuk
approved these changes
Nov 1, 2026
potiuk
left a comment
Member
There was a problem hiding this comment.
Thanks — this layer reads well after the two review rounds. Checked the generation-based discard/requeue, the drain-before-refresh only for refresh_changes_source bundles (so LocalDagBundle never waits), the cooldown on refreshes that fail with an intact source, keeping Dags and import errors for sources whose discovery failed, and the git provider's getattr probe for DagBundleRefreshError so it stays compatible with older cores. Approving; leaving the rebase and merge order of the stack to you.
Drafted-by: Claude Code (Claude Opus 5); reviewed by @potiuk before posting
ephraimbuddy
force-pushed
the
dag-processor-source-consistency
branch
2 times, most recently
from
November 5, 2026 13:11
1eccbc6 to
9bc77b1
Compare
kaxil
approved these changes
Nov 5, 2026
Refreshing a bundle while imports still use its files can associate Dag results with the wrong version or persist results from a replaced source. Discovery failures also cannot establish that previously observed Dag definitions have been deleted.
Holding a bundle's files back until its in-flight imports finish made reparse requests lose their place in the queue, let a steady stream of callbacks keep the refresh waiting indefinitely, and gave operators no sign that files were held back. Checking every bundle on each loop while one waited also added a state query per bundle per loop. A parse that crashed after its bundle re-initialized says nothing about the new source, and copying version metadata on every dispatch grows with manifest size. Files parsed more often than max_runs were queued again, so `airflow dag-processor --num-runs` could never finish.
Fresh CI workers can reach this test before the first 300-second interval has elapsed. The test needs a due refresh followed by a retry within the same interval to cover import draining reliably.
Safe refresh failures should not stop ordinary Dag parsing or consume a reparse request before fresh source is available. Callbacks and finite processing runs must preserve that distinction, and metrics must remain meaningful while files wait for a usable source. Known limitation: the Git provider's Airflow 3.4 version gate still assumes DagBundleRefreshError exists in the installed core. Compatibility with unpatched 3.4 core requires a follow-up before publication.
Some 3.4 core builds predate the refresh-error contract even though they satisfy the provider's version gate. Git bundle configuration must remain usable with those supported cores and retain the original fetch error when the contract is unavailable.
The refresh-error contract is not available in every Airflow 3.4 core build, so provider guidance must describe capability detection. Logger values in the callback source regression only need identity, not mock behavior.
Temporary bundle outages should not delay unrelated parsing or hide its metrics, and credential failures must not discard an intact checkout. Provider compatibility guidance must reflect the features available in the installed core.
When a bundle's refresh succeeded but listing its files or recording the refresh then failed, the bundle was due again at the next check, and a bundle that changes files on refresh drains its active parses before each refresh. A persistent failure, such as a recursive symlink in a Git bundle, therefore cut that bundle's parse throughput at every refresh check for as long as it lasted. Those retries now wait for the bundle's refresh interval, but only when a retry would drain parses. A bundle with nothing listed yet, or one whose refresh never changes files, still retries at the next check, so a failed first listing does not hide its Dags for the whole interval. Passing the failed discovery sources as a new argument to the import-error cleanup made manager subclasses that override it with its original signature crash on their first successful listing, the same kind of break #64245 fixed for Dag deactivation. The cleanup keeps its original signature and reads the failed sources the manager records for the bundle, as Dag deactivation already does. In multi-team deployments, team-filtered dashboards rely on the team_name tag that every other per-bundle Dag processing metric carries, so the per-bundle count of files awaiting a source now carries it too. Starting a processor now requires the parse source, because the dispatch loop always chooses it first and that choice also decides whether the file must wait; the fallback bypassed that decision and its result was discarded as stale in a running processor. The Dag bundle guide now says that object-store bundles pause on every refresh failure, that the retry delay applies only when the provider reports an intact source or when listing or recording a successful refresh fails, and that a processor started with --num-runs waits for a paused bundle, which can otherwise look like a hang. Tests now cover the pause warning, the failed sources reaching Dag deactivation, a skip-refresh override on a bundle's first refresh, and a regular duplicate of a running file.
The provider supports every Airflow 3 core, and cores from 3.0 onwards can lack the refresh-error class, not only some 3.4 builds. The import test patched an Airflow version the provider no longer reads, so its two cases were identical, and its version-based skip kept it from running on the older cores where the probe matters most.
The retry after a failed listing or state write is held for the bundle's refresh interval rather than capped by it, and only a failed listing keeps the earlier file list, so the caveat misdescribed both. Pausing a bundle's parsing while its refresh fails changes what S3, GCS and Azure Blob Storage bundle users saw before, and a processor started with --num-runs can now wait for that refresh to succeed. Upgraders need to read that before they upgrade.
ephraimbuddy
force-pushed
the
dag-processor-source-consistency
branch
from
November 6, 2026 09:07
9bc77b1 to
4552a6b
Compare
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.
Capture bundle version metadata when a parse starts, defer refreshes while the current source is in use, and discard results from superseded sources. Failed discovery preserves existing definitions and import errors for the affected source instead of treating them as deleted.
While a refresh waits, the bundle's files are held back and return to the front of the queue afterwards. A failed refresh pauses parsing for that bundle until a refresh succeeds. New metrics:
dag_processing.files_awaiting_sourceanddag_processing.results_discarded_on_refresh.Layer 2 of the seven-part replacement for #74233, in GitHub native stack #74792. Depends on #74788. Base:
dag-processor-fab-validation.GitHub's Files changed tab shows this layer. Compare this layer.
Merge order:
Was generative AI tooling used to co-author this PR?
Generated-by: Codex (GPT-6) and Claude Code (Opus 5.5) following the guidelines