Repository navigation
Keep backfill authorization off the API server event loop - #76493
aaron-y-chen wants to merge 2 commits into
Conversation
|
Fork CI: green. CI for the latest commit passed in your fork. The pull request is ready for maintainer review. Pull requests from contributors run their CI in the contributor's own fork. GitHub Actions is free and has no minute limit on public forks, while the CI capacity of the Apache Software Foundation is shared by every ASF project and is finite. Fork CI tested this branch merged with How this works: CI in your fork. This comment was posted automatically by the fork CI monitor from templates drafted with an AI-assisted tool, so it may contain mistakes. An Apache Airflow maintainer, a real person, will review the pull request once its fork CI is green. Why the first pass is automated. |
pierrejeambrun
left a comment
There was a problem hiding this comment.
I see that the PR is in draft @aaron-y-chen anything missing before we take a look ?
|
Hi @pierrejeambrun, thanks for asking! this PR is build on #76424: the first commit is copy of that PR, so I'm waiting for it to be reviewed before rebasing this one. The last commit (4ebeb58) has all of this PR's changes, so feel free to review it in the meantime :) |
4ebeb58 to
bfcb88a
Compare
jason810496
left a comment
There was a problem hiding this comment.
Thanks for the PR, one primary comment regarding the session lifecycle.
|
Thanks @jason810496 , both suggestions were really helpful! I've addressed them in my latest commit. Let me know if anything else needs improving :) |
related: #76425
requires_access_backfillis an async dependency, but it looked up the backfill's Dag through the route's sync session, and on a team-name cache miss it also looked up the Dag's team through the syncDagModel.get_team_name. Both calls waited for a pooled connection on the event loop, so once the pool was busy they could stall the whole API server in the same way as #76417. Every/backfills/{backfill_id}route ran the first lookup on every request. The team lookup also ran on routes that name the Dag in the query string or the body (GET /backfills?dag_id=,GET /ui/backfills?dag_id=,POST /backfills,POST /backfills/dry_run). The sweep in #76424 doesn't reach those routes because it sends nodag_id, so the new route tests seed a backfill and cover both cases.Both lookups now run on an async session.
DagModel.get_team_name_asyncshares the existing team-name cache withget_team_name, so a value cached by one is served to the other.This builds on #76424: it removes the backfill lines from
generated/known_sync_db_on_event_loop.txtand uses that PR'sevent_loop_queriesfixture. Until #76424 is merged, the first commit here is a copy of it, so please review only the last commit. I'll drop that copy and rebase ontomainonce #76424 is merged.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5.5) following the guidelines