abhijeets25012-tech opened a new pull request, #61678:
URL: https://github.com/apache/airflow/pull/61678

   ### Summary
   This PR fixes the `sqlalchemy.exc.PendingRollbackError` in Airflow 3.1.7 + 
FAB 3.2.0 by ensuring that the session is rolled back in the `deserialize_user` 
method if an exception occurs.
   
   ### Changes
   - Wrapped the session query in `deserialize_user` with a try-except block.
   - Calls `self.session.rollback()` in case of any exception before re-raising 
it.
   
   ### Issue
   - Related to: #61518
   - This prevents errors like: "Can't reconnect until invalid transaction is 
rolled back".
   
   ### Testing
   - Verified that deserialize_user now properly rolls back failed transactions.
   - No additional changes to other methods.
   
   ### Notes
   - This is a safe, minimal change to prevent session lock issues in FAB auth 
manager.
   
   


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