bujjibabukatta opened a new pull request, #70712: URL: https://github.com/apache/airflow/pull/70712
## Summary `_set_exceeds_max_active_runs` in `scheduler_job_runner.py` now only writes `dag_model.exceeds_max_non_backfill` when the value actually changes, instead of writing it unconditionally on every call. ## Root Cause As described in #70614, this write can block behind the DAG processor's `SELECT ... FOR UPDATE` lock (`find_orm_dags` in `collection.py`), which is held for the whole per-file parse transaction. Since the flag only flips to `True` when a DAG is at its `max_active_runs` limit, most dagrun completions don't actually change it — skipping the write in that case avoids the lock contention for the common case. This reduces how often the contention happens; it doesn't remove it entirely, since the write (and the possible block) still happens when the flag genuinely transitions. The DAG processor's lock scope itself is untouched — that's a separate, bigger fix. related: #70614 ##### Was generative AI tooling used to co-author this PR? - [X] Yes - Claude Generated-by: Claude following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- 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]
