kimyoungi99 commented on code in PR #62214:
URL: https://github.com/apache/airflow/pull/62214#discussion_r2834490022


##########
airflow-core/src/airflow/api_fastapi/app.py:
##########
@@ -138,7 +140,12 @@ def get_auth_manager_cls() -> type[BaseAuthManager]:
 def create_auth_manager() -> BaseAuthManager:
     """Create the auth manager."""
     auth_manager_cls = get_auth_manager_cls()
-    _AuthManagerState.instance = auth_manager_cls()
+    if _AuthManagerState.instance is None or not 
isinstance(_AuthManagerState.instance, auth_manager_cls):
+        with _AuthManagerState._lock:
+            if _AuthManagerState.instance is None or not isinstance(
+                _AuthManagerState.instance, auth_manager_cls
+            ):
+                _AuthManagerState.instance = auth_manager_cls()

Review Comment:
   Good point — moved `get_auth_manager_cls()` inside the lock so the fast path 
is just a None check. 
   
   Added `purge_cached_app()` in `test_upgradedb` to ensure clean state between 
parametrized cases.



-- 
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]

Reply via email to