lohitkolluri commented on code in PR #67900:
URL: https://github.com/apache/airflow/pull/67900#discussion_r3350708054


##########
airflow-core/newsfragments/67900.bugfix.rst:
##########
@@ -0,0 +1 @@
+Handle SQLite ``database is locked`` errors in backfill creation with 
exponential-backoff retries before returning ``503 Service Unavailable``, and 
add the same handling to the dry-run endpoint. Fix unpause backfill not 
committing state change on SQLite.

Review Comment:
   Removed. Per Airflow conventions, newsfragments are only for major/breaking 
changes and are coordinated during review — not added by default.



##########
airflow-core/src/airflow/models/backfill.py:
##########
@@ -653,7 +653,7 @@ def _create_backfill(
             triggering_user_name=triggering_user_name,
         )
         session.add(br)
-        session.commit()
+        session.flush()

Review Comment:
   Good catch — reverting `session.flush()` back to `session.commit()` to 
restore the visibility guarantee. The backfill is now committed immediately so 
concurrent requests see it in the `num_active` check, preventing duplicate 
active backfills. The atomicity trade-off (orphaned backfill if DagRun creation 
fails) is the pre-existing behavior and is acceptable since the error handling 
is already improved with retries and a graceful 503.



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