Skip to content

fix: recover from stale DB session on revoked-token check (#71395) - #71396

Closed
waterWang wants to merge 1 commit into
apache:mainfrom
waterWang:fix-revoked-token-stale-session-recovery
Closed

fix: recover from stale DB session on revoked-token check (#71395)#71396
waterWang wants to merge 1 commit into
apache:mainfrom
waterWang:fix-revoked-token-stale-session-recovery

Conversation

@waterWang

Copy link
Copy Markdown

fixes #71395 (apache/airflow)

Problem

After the api-server sits idle longer than MySQL wait_timeout, the first authenticated request fails with HTTP 500. The OperationalError (MySQL 4031) is raised from RevokedToken.is_revoked, which runs inside BaseAuthManager.get_user_from_token before deserialize_user. The recovery added in #62919 (discard-and-retry in FabAuthManager.deserialize_user) does not cover this earlier check, so the stale-session 500 is back, just one step earlier in the auth path.

Fix

Apply the same discard-and-retry recovery to the revoked-token check: on SQLAlchemyError, discard the poisoned scoped session (settings.Session.remove()) and retry once on a fresh connection. Mirrors the pattern in FabAuthManager.deserialize_user (#62919).

@waterWang
waterWang requested a review from vincbeck as a code owner August 11, 2026 02:55
@boring-cyborg boring-cyborg Bot added the area:API Airflow's REST/HTTP API label Aug 11, 2026
@kaxil

kaxil commented Aug 11, 2026

Copy link
Copy Markdown
Member

Closing this as part of a cleanup of a large batch of PRs opened in quick succession from this account.

18 PRs have been opened here in the past two weeks and none have merged. Several show signs of being generated and submitted without review: #71432 and #71433 are the same change across the same five files, opened two minutes apart, and several titles carry a leaked agent identifier that other contributors already flagged as garbled text on #70629 and #71322.

Airflow is maintained by volunteers. Every PR costs reviewer time and CI capacity, so a high volume of unvetted submissions has a real cost to the project.

You are welcome to keep contributing. Please open one change at a time, run it locally against the tests, and read the contributors' guide before submitting. If you think a specific change here is correct, comment with the reasoning and a maintainer can reopen it.

Note for @vincbeck: this PR carried your approval. It is being closed as part of the batch cleanup above, not on the merits of the diff. Happy to reopen if you would rather see it land.

@kaxil kaxil closed this Aug 11, 2026
@kaxil kaxil added the AI Spam label Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Spam area:API Airflow's REST/HTTP API

Projects

None yet

3 participants