jason810496 commented on code in PR #61310:
URL: https://github.com/apache/airflow/pull/61310#discussion_r2751276702
##########
airflow-core/src/airflow/api_fastapi/app.py:
##########
@@ -57,6 +58,7 @@
class _AuthManagerState:
instance: BaseAuthManager | None = None
+ lock = threading.RLock()
Review Comment:
How about exporting a method for getting the instance and ensure the thread
safety within the method context.
```suggestion
lock = threading.RLock()
@classmethod
def get_instance(cls) -> BaseAuthManager:
if cls._instance is None:
with cls._lock:
if cls._instance is None:
auth_manager_cls = get_auth_manager_cls()
cls._instance = auth_manager_cls()
return cls._instance
```
--
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]