seanmuth commented on code in PR #73692:
URL: https://github.com/apache/airflow/pull/73692#discussion_r4136033653
##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/dags.py:
##########
@@ -199,6 +199,7 @@ class DAGDetailsResponse(DAGResponse):
"dag_run_timeout": "dagrun_timeout",
"last_parsed": "last_loaded",
"template_search_path": "template_searchpath",
+ "is_at_max_active_runs": "exceeds_max_non_backfill",
Review Comment:
Confirmed — you're right, `trigger_dag_run` never touches
`exceeds_max_non_backfill`, so for a `schedule=None` Dag it stayed stale
exactly as you described. Switched `is_at_max_active_runs` to compute fresh at
request time via `DagRun.active_runs_of_dags(exclude_backfill=True)` against
`max_active_runs`, the same way `active_runs_count`/`queued_runs_count` already
do — no more dependency on the parse cycle or scheduler events. Removed the
now-unused alias to `exceeds_max_non_backfill`; that column stays as the
scheduler's own internal optimization, just no longer exposed here. Added a
test that triggers a run and reads details without reparsing — pushed.
---
Drafted-by: Claude Sonnet 5; reviewed by @seanmuth before posting
##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/dags.py:
##########
@@ -221,6 +222,7 @@ class DAGDetailsResponse(DAGResponse):
owner_links: dict[str, str] | None = None
is_favorite: bool = False
active_runs_count: int = 0
+ is_at_max_active_runs: bool
Review Comment:
Added, using your own exact example (the backfill and queued-run cases) —
pushed.
---
Drafted-by: Claude Sonnet 5; reviewed by @seanmuth before posting
##########
airflow-core/src/airflow/dag_processing/collection.py:
##########
@@ -170,15 +170,21 @@ class _RunInfo(NamedTuple):
num_active_runs: int
@classmethod
- def calculate(cls, dag: LazyDeserializedDAG, *, session: Session) -> Self:
+ def calculate(cls, dag: LazyDeserializedDAG, *, num_active_runs: int,
session: Session) -> Self:
Review Comment:
Done — `_RunInfo` and `calculate` now only carry `latest_run`; `update_dags`
reads `active_run_counts.get(dag_id, 0)` directly instead of round-tripping it
through `calculate`'s parameter and return value — pushed.
---
Drafted-by: Claude Sonnet 5; reviewed by @seanmuth before posting
--
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]