Don't deactivate DAG bundles owned by other dag-processors#69964
Merged
hussein-awala merged 1 commit intoJul 17, 2026
Merged
Conversation
hussein-awala
approved these changes
Jul 16, 2026
hussein-awala
left a comment
Member
There was a problem hiding this comment.
Looks good! I reproduced the issue locally and confirmed the fix resolves it. Please drop the newsfragment (we keep those for behavior changes, migrations, or must-highlight items, otherwise the commit message is enough), then LGTM.
`DagBundlesManager.sync_bundles_to_db()` marks every stored bundle that is not in the calling process's config as inactive. This assumes the caller sees the complete bundle configuration. When multiple dag-processors are each configured with a partial config (one bundle per processor, a natural way to shard parsing), each processor treats the other processors' bundles as "no longer found in config" and disables them. Processor A disables B's bundle, B disables A's, and they flip `dag_bundle.active` on every parse cycle -- the deployment never converges and continuously logs "DAG bundle ... is no longer found in config and has been disabled" for bundles that are actively configured elsewhere. Add a `deactivate_missing` flag (default `True`, preserving existing single-processor behavior) and have `DagFileProcessorManager.sync_bundles()` pass `deactivate_missing=False` when the processor was started with a bundle filter (`--bundle-name` / `bundle_names_to_parse`), i.e. when it only owns a subset of the bundles. closes: apache#69963 related: apache#69698 Generated-by: Claude Code following the guidelines
sortega
force-pushed
the
sortega/fix-dag-processor-partial-bundle-config
branch
from
July 16, 2026 15:18
a96da4a to
d01ff90
Compare
hussein-awala
approved these changes
Jul 17, 2026
Contributor
Backport successfully created: v3-3-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
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.
Why
DagBundlesManager.sync_bundles_to_db()marks every bundle stored in the DB that is not present in the calling process's config as inactive ("no longer found in config and has been disabled"). This implicitly assumes the calling process sees the complete bundle configuration.When multiple
dag-processorprocesses are each configured with a partial bundle config — one bundle per processor, a natural way to shard DAG parsing — each processor treats every other processor's bundle as removed and deactivates it. Processor A disables B's bundle, B then disables A's, and they flipdag_bundle.activeon every parse cycle. The deployment never converges and continuously logs the disable warning for bundles that are actively configured on another processor.Minimal reproduction of the flip-flop (two managers with disjoint config, no error path involved):
How
deactivate_missingparameter tosync_bundles_to_db(), defaulting toTrueso existing single-processor / full-config behavior (including cleanup of genuinely-removed bundles) is unchanged.deactivate_missing=False, the method upserts the bundles it knows about and returns without touching the rest.DagFileProcessorManager.sync_bundles()now passesdeactivate_missing=not self.bundle_names_to_parse: a processor started with--bundle-name(a partial owner) will not deactivate bundles it does not own, while an unfiltered processor keeps deactivating removed bundles as before.Tests
test_sync_bundles_to_db_partial_config_does_not_disable_other_bundles— two processors with disjoint configs; asserts both bundles stay active across sync cycles (fails without the fix).test_sync_bundles_deactivates_missing_when_owning_all_bundles/test_sync_bundles_does_not_deactivate_missing_when_filtered— assertsync_bundles()forwards the rightdeactivate_missingvalue based onbundle_names_to_parse.test_sync_bundles_to_db(full-config deactivation) still passes.closes: #69963
related: #69698
Was generative AI tooling used to co-author this PR?