The GitHub Actions job "Tests" on airflow.git/backport-5c9171a-v3-1-test has 
failed.
Run started by GitHub user jason810496 (triggered by jason810496).

Head commit for run:
12990c4c95387e020354512450e281de5016642f / Young-Ki Kim <[email protected]>
[v3-1-test] Fix race condition in auth manager initialization (#62214)

* Fix race condition in auth manager initialization

Make create_auth_manager() thread-safe using double-checked locking
to prevent concurrent requests from creating multiple auth manager
instances. This fixes intermittent 500 errors on /auth/token when
multiple requests arrive simultaneously.

Closes: #61108

* Handle auth manager class change in singleton cache

The singleton check now also verifies the cached instance matches
the currently configured auth manager class. This prevents stale
instances when the config changes (e.g. switching between
SimpleAuthManager and FabAuthManager during db upgrade).

* Avoid calling get_auth_manager_cls on every create_auth_manager call

Move get_auth_manager_cls() inside the lock so the fast path is just a None 
check. Add purge_cached_app() in test_upgradedb to ensure clean state between 
parametrized cases with different auth manager configs.

* Reset auth manager singleton in get_application_builder

Since get_application_builder creates a fresh Flask app each time, the cached 
auth manager singleton from a previous app context must be cleared to avoid 
stale state (e.g. KeyError on AUTH_USER_REGISTRATION).

* Clear auth manager singleton in test fixtures using create_app

Test fixtures that call application.create_app() or get_application_builder()
can receive a stale auth manager singleton from a previous test, causing
AirflowSecurityManagerV2 to be used instead of 
FabAirflowSecurityManagerOverride.

Add purge_cached_app() calls to test fixtures across fab, google, and keycloak
providers to ensure each test gets a fresh auth manager instance.
(cherry picked from commit 5c9171af1a56b5b60bb121537159ceb9c4de9f73)

Co-authored-by: Young-Ki Kim <[email protected]>

Report URL: https://github.com/apache/airflow/actions/runs/22280048722

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to