MarthalaJagruthiReddy opened a new pull request, #72578: URL: https://github.com/apache/airflow/pull/72578
## Summary - Replace the thread-local FAB `security_manager.session` in the users and roles collection handlers with explicit `create_session(scoped=False)` contexts. - Materialize Pydantic responses while the session is open, then close the worker-thread session before returning. - Add regression assertions that the context manager is created with `scoped=False` and exited on success and validation errors. This addresses the sync FastAPI/thread-pool session leak described in #72361 and follows the explicit-session pattern used by Airflow's API code. Fixes #72361 ## Testing - `PYTHONPATH=devel-common/src uv run --project providers/fab --no-dev --with pytest --with pytest-subtests --with pytest-timeout --with time-machine --with pytest-asyncio --with pytest-mock pytest providers/fab/tests/unit/fab/auth_manager/api_fastapi/services/test_users.py providers/fab/tests/unit/fab/auth_manager/api_fastapi/services/test_roles.py -q` - 47 passed, 1 warning -- 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]
