michaelmicheal commented on code in PR #28481:
URL: https://github.com/apache/airflow/pull/28481#discussion_r1055846581


##########
airflow/models/dagwarning.py:
##########
@@ -79,7 +83,12 @@ def purge_inactive_dag_warnings(cls, session: Session = 
NEW_SESSION) -> None:
             query = session.query(cls).filter(cls.dag_id.in_(dag_ids))
         else:
             query = session.query(cls).filter(cls.dag_id == DagModel.dag_id, 
DagModel.is_active == false())
-        query.delete(synchronize_session=False)
+        try:
+            query.delete(synchronize_session=False)
+        except OperationalError:
+            # If the purge query fails, it's not critical to the dag processor
+            # We ignore it so the dag processor manager doesn't exit
+            log.error("Failed to purge inactive dag_warnings, ignoring")

Review Comment:
   What do you think of this? Also, do you think we need to run this query 
every parsing loop? What if we only run it every x seconds and make that 
configurable?



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to