mirror of
https://github.com/apache/superset.git
synced 2026-08-04 04:52:32 +00:00
`get_query` catches any exception from the ORM lookup and relies on the `backoff` decorator to retry up to 5 times. When the underlying failure is (or causes) a SQLAlchemy `PendingRollbackError` - e.g. a `PendingRollbackError` chained under an `OperationalError`/`QueryCanceled` from a dropped connection or statement timeout - the session is left in a broken state that SQLAlchemy refuses to use again until `.rollback()` is called explicitly. Since the session was never rolled back, every one of the 5 retries reused the same poisoned session and failed identically, so the retry loop never had a chance to recover from what may be a transient connection blip. Roll back the session in the except block before raising `SqlLabException` so each `backoff` retry starts from a clean session. The exception raised and logged is unchanged. Fixes SUPERSET-PYTHON-WDZ Co-Authored-By: Claude <noreply@anthropic.com>
22 KiB
22 KiB