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

   Fix FAB auth token deserialization to recover from transient MySQL idle 
disconnects in the same request by clearing scoped session state and retrying 
once; add regression coverage for this recovery path.
   
   This PR closes: #62903
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [x] No 
   
   ### What this PR changes
   - Add a one-time retry in `FabAuthManager.deserialize_user()` after 
`session.remove()` on `SQLAlchemyError`.
   - Keep existing behavior for `NoResultFound` (still raises `ValueError`).
   - If retry also fails, remove session again and re-raise to avoid reusing 
broken transaction/session state.
   - Add regression test proving first-request recovery after transient 
disconnect.
   - Update existing cleanup assertions to account for retry path.
   
   ### Why
   With MySQL idle timeouts, the first request can hit a dead connection and 
return 500, while the next request succeeds. Retrying once after scoped-session 
cleanup makes the first request recover instead of failing.
   
   ### Unit Tests
   Have updated the existing unit test and validated the same


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