Sathvik-Chowdary-Veerapaneni commented on code in PR #63692:
URL: https://github.com/apache/airflow/pull/63692#discussion_r3033833186


##########
airflow-core/src/airflow/callbacks/callback_requests.py:
##########
@@ -116,19 +115,20 @@ def _sanitize_consumed_asset_events(cls, values: 
Mapping[str, Any]) -> Mapping[s
         except NoInspectionAvailable:
             return values
 
-        # Relationship access may raise DetachedInstanceError; on that path, 
reload DagRun
-        # from the DB to avoid crashing the scheduler.
+        # Relationship access may raise DetachedInstanceError or other 
SQLAlchemy
+        # exceptions (e.g. InvalidRequestError when the session is closed); on 
that
+        # path, reload the DagRun from the DB to avoid crashing the scheduler.
         try:
             events = dag_run.consumed_asset_events
             set_committed_value(
                 dag_run,
                 "consumed_asset_events",
                 list(events) if events is not None else [],
             )
-        except DetachedInstanceError:
+        except Exception:

Review Comment:
   Done, narrowed it to SQLAlchemyError in 9a0183e.



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