steveahnahn commented on code in PR #71287:
URL: https://github.com/apache/airflow/pull/71287#discussion_r3762296105
##########
airflow-core/src/airflow/utils/sqlalchemy.py:
##########
@@ -635,10 +658,12 @@ class CommitProhibitorGuard:
def __init__(self, session: Session):
self.session = session
- def _validate_commit(self, _):
+ def _validate_commit(self, session):
if self.expected_commit:
self.expected_commit = False
return
+ if session.info.get(_EXPECTED_SAVEPOINT_COMMIT) and
session.in_nested_transaction():
Review Comment:
_EXPECTED_SAVEPOINT_COMMIT is session-wide, so this exemption fires for any
nested commit while it is set, not just the savepoint that set it. It's safe as
written since it is only set across the synchronous savepoint.commit() on a
single-threaded session but a one-line comment saying so would help, and it
would need rethinking if nested savepoints ever land on this path.
--
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]