You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stop passing lazy queries into Iterable[] API response fields #76683
An Iterable[...] response field is validated lazily, so its rows are fetched while FastAPI serializes the response — on the event loop, on the sync engine. Once the connection pool is busy, that blocks the whole API server.
The seven routes below hand the field the lazy session.scalars(...) directly. #74247 and #76525 fixed the same shape for pools, dags and deadlines. #76537 adds a test that lists these seven in generated/known_lazy_response_fields.txt as strict xfails, so the list cannot grow.
Annotate the field list[X] instead of Iterable[X], and materialize at the route with .all() or list(...). The OpenAPI schema is unchanged, so no client is affected.
Eager-load anything the items resolve on access, or serialization still runs a query per item.
Delete the field's line from generated/known_lazy_response_fields.txt. Each line is a strict xfail, so the run fails until it is removed.
One field per PR is fine.
Not in scope
Thirteen other Iterable[...] fields are exempt: their routes resolve the items first, and Iterable there is the deliberate choice from #57878.
Committer
I acknowledge that I am a maintainer/committer of the Apache Airflow project.
Activity
its-amann commentedon Nov 7, 2026
working on the connections and variables ones, will open a PR for each
henry3260 commentedon Nov 7, 2026
Maybe you should wait for our discussion in #76537
henry3260 commentedon Nov 8, 2026
We only need to fix one place, so we don't need to open pr to track this
Exempt the lazy response fields whose items arrive resolved
Stop API responses from resolving their items on the event loop (#76537)