-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add retry to submit_event in trigger to avoid deadlock #27344
Conversation
@NickYadance did you try this fix? did it resolve the issue? do you think it's possible to write a test for it? i imagine you could might simulate the scenario by managing two sessions. if so, you could write a test that reliably fails without the fix, then add the fix and leave the test. the reason I ask is because i see that that the retry is within the scope of the session, and i'm not sure whether, if we get a deadlock error, the session will need to be rolled back. and, another option would be to put |
No actually. The solution is from here as these are similiar cases. airflow/airflow/models/trigger.py Lines 100 to 104 in b29ca4e
Working on to reproduce this... |
Here's an example that illustrates what I'm saying:
This line The first two times it runs, it runs with dict. The third time it runs with string. But you will see that it doesn't matter that the third try uses a good value; it will still fail because the transaction has not been rolled back. The only difference is the error is Now... is that a difference that makes a difference? I am not sure. But, I think it's likely. If that's true, this won't work and you'll have to do the retry around the whole transaction instead of within it (which, thankfully, isn't that big of a change). |
@NickYadance did you give up on this one? |
nop. i just rebase my source repo cuz i'm testing another issue. |
related: #27000