Explicitly rollback on task state update exception - #71076
Conversation
This ensures everything is reset when something fails, including asset registration db calls previously made.
c12e418 to
2482b71
Compare
|
Test added |
|
Hi maintainer, this PR was merged without a milestone set.
|
Backport failed to create: v3-3-test. View the failure log Run detailsNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
You can attempt to backport this manually by running: cherry_picker 64002a4 v3-3-testThis should apply the commit to the v3-3-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continueIf you don't have cherry-picker installed, see the installation guide. |
|
I’ll simply add this to #71065. |
…71065) * [v3-3-test] Release TI lock before asset listener callbacks (#70951) * Release TI lock before asset listener callbacks Asset registration on the task-success path (ti_update_state) ran the listener hooks synchronously inside the transaction holding a row lock on the task_instance table. A slow listener, multiplied across a large fan-out of asset events, could hold that lock for minutes, causing statement timeouts. The listener hooks are now deferred until the end of the endpoint instead of executed inline during asset event creation. Registration writes to the database still happen under the caller's transaction, so durability is unchanged; this only moves the best-effort listener hooks off the lock. * Optimize asset alias assoc insert * Fix exhausted iterator reuse bug * Test asset reg callback cases (cherry picked from commit 79db995) Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com> * [v3-3-test] Explicitly rollback on task state update exception (#71076) --------- Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
One small gap discovered when analyzing #70951.
This ensures everything is reset when something fails, including asset registration db calls previously made.