Skip to content

Mark Dags stale when their bundle is removed from config#66948

Open
ephraimbuddy wants to merge 1 commit into
apache:mainfrom
astronomer:mark-dags-stale-when-bundle-removed
Open

Mark Dags stale when their bundle is removed from config#66948
ephraimbuddy wants to merge 1 commit into
apache:mainfrom
astronomer:mark-dags-stale-when-bundle-removed

Conversation

@ephraimbuddy
Copy link
Copy Markdown
Contributor

When a Dag bundle is removed from the bundle config, sync_bundles_to_db flipped the bundle's active flag to False but left its Dags with is_stale=False. The processor stops parsing files for inactive bundles, so the time-based check in deactivate_stale_dags never fired for them.

deactivate_stale_dags now reads the set of active bundles from the DagBundleModel table and treats any non-stale Dag whose bundle is not active as stale, in addition to the existing last_parsed_time check for Dags in active bundles. If the bundle reappears in config later, the existing parse path resets is_stale to False per Dag.

When a Dag bundle is removed from the bundle config, sync_bundles_to_db
flipped the bundle's active flag to False but left its Dags with
is_stale=False. The processor stops parsing files for inactive bundles,
so the time-based check in deactivate_stale_dags never fired for them.

deactivate_stale_dags now reads the set of active bundles from the
DagBundleModel table and treats any non-stale Dag whose bundle is not
active as stale, in addition to the existing last_parsed_time check for
Dags in active bundles. If the bundle reappears in config later, the
existing parse path resets is_stale to False per Dag.
@ephraimbuddy ephraimbuddy added type:bug-fix Changelog: Bug Fixes backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch labels May 14, 2026
@ephraimbuddy ephraimbuddy added this to the Airflow 3.2.2 milestone May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:DAG-processing backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant