Vamsi-klu opened a new pull request, #68518:
URL: https://github.com/apache/airflow/pull/68518

   Fixes #66104.
   
   When `[core] dag_discovery_safe_mode` is `False`, Dags defined in ZIP 
archives whose source does not contain the `airflow`/`dag` keywords were parsed 
and activated by the Dag file processor but then immediately deactivated on the 
next scan. `_get_observed_filelocs` expanded ZIP members with a hardcoded 
`safe_mode=True`, so keyword-less members were absent from the observed set and 
`deactivate_deleted_dags` marked them stale.
   
   Changes:
   - Resolve `dag_discovery_safe_mode` once on `DagFileProcessorManager` and 
use it for both file discovery (`_find_files_in_bundle`) and the 
observed-filelocs scan (`_get_observed_filelocs`), fixing the hardcoded `True`.
   - Log the effective `dag_discovery_safe_mode` per bundle. In 
separate-process deployments (Helm/OpenShift) the flag must be set on the 
dag-processor and the component restarted; otherwise Dags appear after `airflow 
dags reserialize` and disappear on the next scan (the plain-.py symptom in the 
issue). The log makes that misconfiguration diagnosable.
   - Clarify the config.yml / docs guidance accordingly.
   
   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?
   
   - [X] Yes — Claude Code (Opus 4.8)
   
   Generated-by: Claude Code (Opus 4.8) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to