ashb commented on a change in pull request #5743: [AIRFLOW-5088][AIP-24] 
Persisting serialized DAG in DB for webserver scalability
URL: https://github.com/apache/airflow/pull/5743#discussion_r313870289
 
 

 ##########
 File path: airflow/api/common/experimental/delete_dag.py
 ##########
 @@ -45,6 +49,11 @@ def delete_dag(dag_id: str, keep_records_in_log: bool = 
True, session=None) -> i
         raise DagFileExists("Dag id {} is still in DagBag. "
                             "Remove the DAG file first: {}".format(dag_id, 
dag.fileloc))
 
+    # Scheduler removes DAGs without files from serialized_dag table every 
dag_dir_list_interval.
+    # There may be a lag, so explicitly removes serialized DAG here.
+    if DAGCACHED_ENABLED and SerializedDagModel.has_dag(dag_id):
+        SerializedDagModel.remove_dag(dag_id)
 
 Review comment:
   ```suggestion
           SerializedDagModel.remove_dag(dag_id, session=session)
   ```
   
   May need to extend that method to take a session argument, but this way it 
all happens inside the same DB txn.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to