[v3-3-test] Release TI lock before asset listener callbacks (#70951) - #71065
Merged
Conversation
* 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>
vatsrahul1001
marked this pull request as ready for review
August 4, 2026 06:59
vatsrahul1001
requested review from
Lee-W,
XD-DENG,
amoghrajesh,
ashb,
kaxil and
uranusjr
as code owners
August 4, 2026 06:59
Lee-W
approved these changes
Aug 4, 2026
Member
|
I found a small gap for this, fixing in #71076. The two will need to be backported together. |
Member
|
Backport for #71076 will be added to this PR. |
uranusjr
force-pushed
the
backport-79db995-v3-3-test
branch
from
August 4, 2026 11:25
2efe792 to
b5e4f91
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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