dstandish commented on code in PR #46248:
URL: https://github.com/apache/airflow/pull/46248#discussion_r1941709575


##########
airflow/models/backfill.py:
##########
@@ -389,34 +391,36 @@ def _create_backfill(
             dag=dag,
         )
 
-        log.info("obtaining lock on dag %s", dag_id)
-        # we obtain a lock on dag model so that nothing else will create
-        # dag runs at the same time. mainly this is required by non-uniqueness
-        # of logical_date. otherwise we could just create run in a try-except.
-        dag_model = session.scalar(
-            with_row_locks(
-                select(DagModel).where(DagModel.dag_id == dag_id),
-                session=session,
-            )
-        )
+        dag_model = session.scalar(select(DagModel).where(DagModel.dag_id == 
dag_id))
+
         if not dag_model:
             raise RuntimeError(f"Dag {dag_id} not found")
 
         for info in dagrun_info_list:
             backfill_sort_ordinal += 1
-            _create_backfill_dag_run(
-                dag=dag,
-                info=info,
-                backfill_id=br.id,
-                dag_run_conf=br.dag_run_conf,
-                reprocess_behavior=br.reprocess_behavior,
-                backfill_sort_ordinal=backfill_sort_ordinal,
-                session=session,
-            )
-            log.info(
-                "created backfill dag run dag_id=%s backfill_id=%s, info=%s",
-                dag.dag_id,
-                br.id,
-                info,
-            )
+            try:

Review Comment:
   hmm so .... you are adding integrity error handling both inside 
`_create_backfill_dag_run` and at the call site of `_create_backfill_dag_run`.  
i don't think you need it in both places.  you have to decide where it makes 
sense to add.



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