Repository navigation
Skip redundant dag.exceeds_max_non_backfill writes to reduce scheduler/DAG-processor lock contention - #70712
Skip redundant dag.exceeds_max_non_backfill writes to reduce scheduler/DAG-processor lock contention#70712bujjibabukatta wants to merge 1 commit into
Conversation
…r/DAG-processor lock contention
7f22454 to
7dd8d5b
Compare
steveahnahn
left a comment
There was a problem hiding this comment.
Thanks for the work but I couldn't reproduce the write this removes, notes inline, happy to approve if i'm mistaken.
|
Hello @bujjibabukatta - thank you for your contributions to Apache Airflow! The Airflow community has introduced a limit of 5 open pull requests at a time for contributors without write access to the repository. You currently have 16 open pull requests, so - as a one-time step of introducing the limit - we closed the ones where maintainers have not engaged yet:
These pull requests stay open because maintainers are already engaged in them - they count towards your limit:
This is not a judgement of you or of your changes. We never told contributors before that opening many pull requests at once was a problem, so there is nothing to feel bad about - and nothing is lost: your branches, commits and the review history stay where they are. What we ask you to do is to make your first prioritization decision: choose which of the pull requests above matter most to you, and reopen them (up to 5 open at a time, including the ones still open) with the "Reopen pull request" button or While your pull requests are waiting for review, the most valuable thing you can do is help in other ways - reviewing other contributors' pull requests, helping with issues, and taking part in the discussions on the devlist and Slack. Why we introduced the limit, what it means for you and how to reopen or restore a pull request is explained in https://github.com/apache/airflow/blob/main/contributing-docs/32_open_pull_request_limit.rst. Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting |
Summary
_set_exceeds_max_active_runsinscheduler_job_runner.pynow onlywrites
dag_model.exceeds_max_non_backfillwhen the value actuallychanges, 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 UPDATElock (find_orm_dagsincollection.py), which is held for the whole per-file parsetransaction. Since the flag only flips to
Truewhen a DAG is at itsmax_active_runslimit, most dagrun completions don't actually changeit — 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?
Generated-by: Claude following the guidelines