waterWang opened a new pull request, #71396:
URL: https://github.com/apache/airflow/pull/71396

   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).


-- 
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]

Reply via email to