-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
Resolve trigger assignment race condition #27072
Conversation
1397966
to
d9ccf03
Compare
Found util to add row locks by configuration or if dialect supports, updated with that change. |
cool 👍 looks like you maybe need to get your pre-commit hooks working locally... the formatting looks a little funky, but let's see what tests say |
I re-based it to account for failed image build. And it looks good in general. |
skip_locked=True, | ||
).all() | ||
if trigger_ids_query: | ||
session.query(cls).filter(cls.id.in_([i.id for i in trigger_ids_query])).update( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to transform trigger_ids_query
to a subquery so this can be done in one db call instead of two?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@uranusjr As discussed update with limit is not supported, and adding subquery on same table is not supported in mysql
Awesome work, congrats on your first merged pull request! |
closes: #27057
Added for update to avoid race condition between mutiple triggerer process
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in newsfragments.