Skip to content

Cache bundle-to-team name lookups in dag processor manager#68730

Open
ferruzzi wants to merge 1 commit into
apache:mainfrom
aws-mwaa:ferruzzi/multi-team/bundle-cache
Open

Cache bundle-to-team name lookups in dag processor manager#68730
ferruzzi wants to merge 1 commit into
apache:mainfrom
aws-mwaa:ferruzzi/multi-team/bundle-cache

Conversation

@ferruzzi

Copy link
Copy Markdown
Contributor

Follow-up to request by @o-nikolas in #68599 to add caching like we did in the scheduler.

Adding a _bundle_name_to_team_name map/cache and a _multi_team flag (read once at construction, like the scheduler) on DagFileProcessorManager also allowed me to move the if multi-team check into the _get_team_names() and _get_team_name() helpers, simplifying the calling code.

The cache/map is cleared inside the _refresh_dag_bundles() method, which is the only time we can pick up new mappings anyway.


Was generative AI tooling used to co-author this PR?
  • [ x ] Yes (please specify the tool below)

Generated-by: [Claude Opus 4.8] following the guidelines


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@seanghaeli seanghaeli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified in breeze that the cache produces correct results, invalidation works, the n->1 query batching works, and a bundle can't be mapped to a second team

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants