Skip to content

[v3-1-test] Fix dag processor callback cleanup for versioned bundle files (#66484)#69771

Open
Vamsi-klu wants to merge 2 commits into
apache:v3-1-testfrom
Vamsi-klu:backport-v3-1-callback-versioned-bundle
Open

[v3-1-test] Fix dag processor callback cleanup for versioned bundle files (#66484)#69771
Vamsi-klu wants to merge 2 commits into
apache:v3-1-testfrom
Vamsi-klu:backport-v3-1-callback-versioned-bundle

Conversation

@Vamsi-klu

@Vamsi-klu Vamsi-klu commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Backport of #66484 ("Fix dag processor callback cleanup for versioned bundle files") to v3-1-test, addressing #63374 where Dag-level on_failure_callback could be dropped for versioned/git bundles before it was processed.

Problem

The Dag File Processor queued callback files with a DagFileInfo whose bundle_version participates in equality. The periodic scan recreated the same file with bundle_version=None, so cleanup treated the queued versioned callback file as missing and purged it before processing.

What Changed

  • Backported the version-independent presence_key handling from Fix dag processor callback cleanup for versioned bundle files #66484.
  • Kept the v3-1-test Stats.gauge spelling while resolving the cherry-pick context conflict.
  • Added a follow-up commit that removes the dead processed_recently() helper and tightens the new regression tests with deterministic time and specced/autospecced mocks.

Why The Follow-Up Commit Exists

The review feedback was correct: the backport carried a now-unused helper and a few tests were too loose for release-branch review. The follow-up does not change the fix behavior; it makes the backport smaller and the test evidence stronger.

Impact

The backport should only affect cleanup/termination decisions for versioned callback files. Normal Dag file processing and unversioned callback cleanup continue to use the same presence logic.

No new newsfragment was added because the original user-facing changelog entry already exists for #66484 on main.

related: #63374

Testing

  • AIRFLOW_HOME=/tmp/airflow-home-69771 UV_CACHE_DIR=/tmp/uv-cache-69771 uv run --project airflow-core pytest airflow-core/tests/unit/dag_processing/test_manager.py::TestDagFileProcessorManager::test_handle_removed_files_uses_public_extension_points airflow-core/tests/unit/dag_processing/test_manager.py::TestDagFileProcessorManager::test_purge_removed_files_keeps_versioned_callback_file_when_unversioned_file_is_present airflow-core/tests/unit/dag_processing/test_manager.py::TestDagFileProcessorManager::test_terminate_orphan_processes_keeps_versioned_callback_processor_when_unversioned_file_is_present airflow-core/tests/unit/dag_processing/test_manager.py::TestDagFileProcessorManager::test_terminate_orphan_processes_kills_processor_when_file_is_truly_absent airflow-core/tests/unit/dag_processing/test_manager.py::TestDagFileProcessorManager::test_add_new_files_to_queue_skips_versioned_files_already_represented airflow-core/tests/unit/dag_processing/test_manager.py::TestDagFileProcessorManager::test_prepare_file_queue_skips_file_when_versioned_processor_is_in_progress airflow-core/tests/unit/dag_processing/test_manager.py::TestDagFileProcessorManager::test_prepare_file_queue_skips_recently_processed_file_with_versioned_stats --with-db-init -xvs
  • Result: 7 passed, 1 warning
  • Commit hooks passed for the follow-up commit.

Was generative AI tooling used to co-author this PR?
  • Yes — Codex (GPT-5)

Generated-by: Codex (GPT-5) following the guidelines


Drafted-by: Codex (GPT-5); reviewed by @Vamsi-klu before posting

…#66484)

* Fix callback orphan cleanup for versioned bundle files

closes: apache#66483

* Remove newsfragment for callback orphan cleanup fix

* Fix versioned dag file presence checks

* Preserve public signatures for versioned dag file checks

* Preserve manager cleanup extension points
@Vamsi-klu Vamsi-klu marked this pull request as ready for review July 11, 2026 23:55
The backport already fixes the versioned bundle callback cleanup path, but the follow-up keeps the regression coverage deterministic and easier to maintain before release-manager review.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants