Skip to content
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

Don't wait for lock on DagRun in mini scheduler #38914

Merged

Conversation

dstandish
Copy link
Contributor

We should just bail if something else is already "minischeduling". We already catch OperationalError so there's nothing else we need to change for this.

@collinmcnulty and @jedcunningham you might be interested in this. Discovered in collaboration with @seanmuth that this can cause an issue if many tasks from same dag run are trying to "minischedule" at the same time. E.g. task mapping. If something else is already locking, we should just move on and not wait.

We should just bail if something else is already "minischeduling".  We already catch OperationalError so there's nothing else we need to change for this.
Copy link
Member

@Lee-W Lee-W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds reasonable 👍

@ashb
Copy link
Member

ashb commented Apr 11, 2024

This might have the inverse effect of putting more load on the scheduler as it might end up doing more task expansion

@dstandish dstandish merged commit afe8e82 into apache:main Apr 11, 2024
42 checks passed
@dstandish dstandish deleted the add-nowait-to-minischeduler-dagrun-lock branch April 11, 2024 03:06
@jedcunningham jedcunningham added this to the Airflow 2.9.1 milestone Apr 26, 2024
@jedcunningham jedcunningham added the type:bug-fix Changelog: Bug Fixes label Apr 26, 2024
jedcunningham pushed a commit that referenced this pull request Apr 26, 2024
We should just bail if something else is already "minischeduling".  We already catch OperationalError so there's nothing else we need to change for this.

Sometimes (e.g. with certain task mapping scenarios) many tasks from same dag run are trying to "minischedule" at the same time.  If something else is already locking, it's probably better to just move on and not wait.

(cherry picked from commit afe8e82)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants