ehab20011 opened a new issue, #60559:
URL: https://github.com/apache/airflow/issues/60559

   ### Apache Airflow version
   
   2.11.X
   
   ### If "Other Airflow 3 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   When multiple DAG files define DAGs with the same dag_id, Airflow parses all 
of them and silently keeps only one DAG definition (the last one parsed). The 
previously parsed DAG is overwritten with no warning or error in logs or UI.
   
   Because DAG file parse order is not deterministic (especially in distributed 
or object-store–backed environments such as GCS / Cloud Composer), the 
“winning” DAG definition can change between scheduler restarts or parse cycles 
without any code changes.
   
   ### What you think should happen instead?
   
   At minimum, Airflow should notify users when duplicate dag_ids are detected.
   
   Possible improvements (in increasing strictness):
   - UI warning/banner indicating multiple DAG definitions exist
   - Optional config flag to fail DAG parsing on duplicate dag_ids
   - Include the source file paths of conflicting DAG definitions
   
   This would be similar in spirit to existing safeguards for duplicate task 
IDs, but applied at the DAG level.
   
   ### How to reproduce
   
   **Reproduction**
   
   1. Create two DAG files:
   
   dag_a.py
   dag_b.py
   
   2. Both define dag_id="example_dag" but with different task graphs
   3. Place both in the DAGs folder
   4. Wait for parse cycle
   5. Observe that airflow struggles to pick which one and falls back to 
whichever one wins the race of parsing
   
   ### Operating System
   
   Linux (Cloud Composer / Google Kubernetes Engine)
   
   ### Versions of Apache Airflow Providers
   
   N/A – issue is in core DAG parsing, not provider-related
   
   ### Deployment
   
   Google Cloud Composer
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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