Skip to content

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

Merged
ephraimbuddy merged 2 commits into
apache:mainfrom
astronomer:mark-dags-stale-when-bundle-removed
May 15, 2026
Merged

Mark Dags stale when their bundle is removed from config#66948
ephraimbuddy merged 2 commits 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.
Comment thread airflow-core/src/airflow/dag_processing/manager.py Outdated
Comment thread airflow-core/src/airflow/dag_processing/manager.py Outdated
Co-authored-by: Wei Lee <weilee.rx@gmail.com>
@ephraimbuddy ephraimbuddy merged commit 01be07a into apache:main May 15, 2026
79 checks passed
@ephraimbuddy ephraimbuddy deleted the mark-dags-stale-when-bundle-removed branch May 15, 2026 10:11
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-2-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
v3-2-test PR Link

github-actions Bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request May 15, 2026
…pache#66948)

* Mark Dags stale when their bundle is removed from config

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.

* Apply suggestions from code review

Co-authored-by: Wei Lee <weilee.rx@gmail.com>

---------
(cherry picked from commit 01be07a)

Co-authored-by: Ephraim Anierobi <splendidzigy24@gmail.com>
Co-authored-by: Wei Lee <weilee.rx@gmail.com>
aws-airflow-bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request May 15, 2026
…pache#66948)

* Mark Dags stale when their bundle is removed from config

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.

* Apply suggestions from code review

Co-authored-by: Wei Lee <weilee.rx@gmail.com>

---------
(cherry picked from commit 01be07a)

Co-authored-by: Ephraim Anierobi <splendidzigy24@gmail.com>
Co-authored-by: Wei Lee <weilee.rx@gmail.com>
Nishieee pushed a commit to Nishieee/airflow that referenced this pull request May 15, 2026
* Mark Dags stale when their bundle is removed from config

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.

* Apply suggestions from code review

Co-authored-by: Wei Lee <weilee.rx@gmail.com>

---------

Co-authored-by: Wei Lee <weilee.rx@gmail.com>
vatsrahul1001 added a commit that referenced this pull request May 18, 2026
…66948) (#66985)

* Mark Dags stale when their bundle is removed from config

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.

* Apply suggestions from code review



---------
(cherry picked from commit 01be07a)

Co-authored-by: Ephraim Anierobi <splendidzigy24@gmail.com>
Co-authored-by: Wei Lee <weilee.rx@gmail.com>
Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com>
vatsrahul1001 added a commit that referenced this pull request May 20, 2026
…66948) (#66985)

* Mark Dags stale when their bundle is removed from config

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.

* Apply suggestions from code review



---------
(cherry picked from commit 01be07a)

Co-authored-by: Ephraim Anierobi <splendidzigy24@gmail.com>
Co-authored-by: Wei Lee <weilee.rx@gmail.com>
Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com>
vatsrahul1001 added a commit that referenced this pull request May 20, 2026
…66948) (#66985)

* Mark Dags stale when their bundle is removed from config

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.

* Apply suggestions from code review



---------
(cherry picked from commit 01be07a)

Co-authored-by: Ephraim Anierobi <splendidzigy24@gmail.com>
Co-authored-by: Wei Lee <weilee.rx@gmail.com>
Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com>
vatsrahul1001 added a commit that referenced this pull request May 21, 2026
…66948) (#66985)

* Mark Dags stale when their bundle is removed from config

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.

* Apply suggestions from code review



---------
(cherry picked from commit 01be07a)

Co-authored-by: Ephraim Anierobi <splendidzigy24@gmail.com>
Co-authored-by: Wei Lee <weilee.rx@gmail.com>
Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants