Keep ZIP-archived Dags active when dag_discovery_safe_mode is False#68518
Open
Vamsi-klu wants to merge 1 commit into
Open
Keep ZIP-archived Dags active when dag_discovery_safe_mode is False#68518Vamsi-klu wants to merge 1 commit into
Vamsi-klu wants to merge 1 commit into
Conversation
2e35a34 to
11741f4
Compare
The Dag file processor parsed and activated keyword-less Dags inside ZIP archives but then immediately deactivated them, because the scan that decides which files still exist ignored dag_discovery_safe_mode and always applied the airflow/dag keyword heuristic. Resolve the setting once and use it consistently for discovery and the deactivation scan, and log the effective value so a misconfigured processor is diagnosable. closes: apache#66104
11741f4 to
942843f
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.
Fixes #66104.
When
[core] dag_discovery_safe_modeisFalse, Dags defined in ZIP archives whose source does not contain theairflow/dagkeywords were parsed and activated by the Dag file processor but then immediately deactivated on the next scan._get_observed_filelocsexpanded ZIP members with a hardcodedsafe_mode=True, so keyword-less members were absent from the observed set anddeactivate_deleted_dagsmarked them stale.Changes:
dag_discovery_safe_modeonce onDagFileProcessorManagerand use it for both file discovery (_find_files_in_bundle) and the observed-filelocs scan (_get_observed_filelocs), fixing the hardcodedTrue.dag_discovery_safe_modeper bundle. In separate-process deployments (Helm/OpenShift) the flag must be set on the dag-processor and the component restarted; otherwise Dags appear afterairflow dags reserializeand disappear on the next scan (the plain-.py symptom in the issue). The log makes that misconfiguration diagnosable.Tested: new parametrized regression test
test_get_observed_filelocs_respects_dag_discovery_safe_mode(keyword-less ZIP member is observed when safe_mode is False, filtered when True).Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.8) following the guidelines