This is an automated email from the ASF dual-hosted git repository.

vincbeck pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 2f4625a7d4d Improve DAG authorization filtering performance (#71722)
2f4625a7d4d is described below

commit 2f4625a7d4d24a04ad45a6c7ac5eb1dc97e72ec5
Author: abhijeets25012-tech <[email protected]>
AuthorDate: Tue Aug 18 21:23:15 2026 +0530

    Improve DAG authorization filtering performance (#71722)
---
 .../src/airflow/api_fastapi/auth/managers/base_auth_manager.py   | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git 
a/airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py 
b/airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py
index f780097cea4..f8171a9db83 100644
--- a/airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py
+++ b/airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py
@@ -22,6 +22,7 @@ import logging
 import warnings
 from abc import ABCMeta, abstractmethod
 from collections import defaultdict
+from concurrent.futures import ThreadPoolExecutor
 from enum import Enum
 from functools import cache, cached_property
 from typing import TYPE_CHECKING, Any, Generic, Literal, TypeVar
@@ -692,7 +693,13 @@ class BaseAuthManager(Generic[T], LoggingMixin, 
metaclass=ABCMeta):
                 method=method, details=DagDetails(id=dag_id, 
team_name=team_name), user=user
             )
 
-        return {dag_id for dag_id in dag_ids if _is_authorized_dag_id(dag_id)}
+        if not dag_ids:
+            return set()
+
+        with ThreadPoolExecutor() as executor:
+            results = executor.map(_is_authorized_dag_id, dag_ids)
+
+        return {dag_id for dag_id, authorized in zip(dag_ids, results) if 
authorized}
 
     @provide_session
     def get_authorized_pools(

Reply via email to