Uh oh!
There was an error while loading. Please reload this page.
Make auth manager initialization thread-safe - #61310
Make auth manager initialization thread-safe#61310Alok-kumar-priyadarshi wants to merge 6 commits into
Conversation
jason810496
left a comment
There was a problem hiding this comment.
Nice! Thanks for the PR.
It would be nice to add the corresponding unit test, thanks!
Uh oh!
There was an error while loading. Please reload this page.
Alok-kumar-priyadarshi
commented
Feb 1, 2026
Thanks for the review! |
jason810496
left a comment
There was a problem hiding this comment.
Thanks for the update!
Happy to add targeted tests if you'd like me to include them in a follow-up.
Please add the tests in current PR to ensure the stability. Thanks!
Alok-kumar-priyadarshi
commented
Feb 2, 2026
Added a focused unit test covering concurrent auth manager initialization and singleton behavior. |
Uh oh!
There was an error while loading. Please reload this page.
Alok-kumar-priyadarshi
commented
Feb 2, 2026
Thanks for the guidance ! @vincbeck |
jason810496
left a comment
There was a problem hiding this comment.
Nice! I just triggered the CI again, I will merge this once the CI pass.
vincbeck
commented
Feb 3, 2026
Tests are failing |
bugraoz93
left a comment
There was a problem hiding this comment.
Looks good! I think there is already good enough approvals but wanted to ping again on tests failing for multiple things :) Thanks for the PR!
Alok-kumar-priyadarshi
commented
Feb 5, 2026
Please let me know if the failures are related to my changes — I’m happy to investigate and fix them if needed. |
There was a problem hiding this comment.
Please let me know if the failures are related to my changes — I’m happy to investigate and fix them if needed.
Yes, I just confirmed that all the test failures are related to Auth Manager. Please go through the logs and fix them when you get a chance. Thanks!
Feel free to mark the PR as "Ready for review" once all the errors are resolved.
dfb1941 to
0f0fde6Comparevincbeck
commented
Feb 13, 2026
Can you rebase? The CI was broken yesterday |
b71bec7 to
f2655e1CompareAlok-kumar-priyadarshi
commented
Feb 14, 2026
I’ve rebased onto the latest main and all CI checks are now passing. Thanks! |
jason810496
left a comment
There was a problem hiding this comment.
As mentioned in #61310 (review)
Please update the corresponding unit tests to resolve all the CI failures.
I will recommend to setup Breeze via https://github.com/apache/airflow/tree/main/contributing-docs and test those failing test cases locally in breeze shell before marking the PR as ready to review.
Thanks!
…de activation in API server CLI
6a7d415 to
2dcb2bdCompareAlok-kumar-priyadarshi
commented
Feb 17, 2026
Hi, Make AuthManager initialization thread-safe using a guarded instance check with RLock. Fix unintended dev-mode activation in api_server_command by replacing should_enable_hot_reload() with an explicit args.dev check (this was affecting uvicorn invocation arguments in tests). All relevant unit tests pass locally. |
| get_signing_args() | ||
| if cli_utils.should_enable_hot_reload(args): | ||
| if getattr(args, "dev", False): |
There was a problem hiding this comment.
Why change that? It seems unrelated to the PR.
potiuk
commented
Feb 19, 2026
There are plenty of issues in the tests and lots of discussions that take a lot of time. I suggest you open a new PR which actually has green PR and solves the issue. |
Closes#61108
Summary
This PR fixes a race condition in FastAPI auth manager initialization that could cause intermittent 500 Internal Server Error responses under concurrent authentication requests.
Fix
Make auth manager creation thread-safe
Ensure the manager is initialized exactly once
Prevent concurrent requests from accessing an uninitialized instance
Notes
Internal change only
No user-facing or configuration changes
Verified with concurrent /auth/token requests