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

Fix exception in mini task scheduler. #24865

Merged
merged 1 commit into from
Jul 6, 2022

Conversation

ashb
Copy link
Member

@ashb ashb commented Jul 6, 2022

I introduced a bug in 2.3.0 as part of the dynamic task mapping work
that frequently made the mini scheduler fail for tasks involving
XComArgs.

The fix is to alter the logic in BaseOperator's deepcopy to not set the
__instantiated flag until all the other attributes are copied.

For background the __instantiated flag is use so that when you do
task.some_attr = an_xcom_arg the relationships are set appropriately,
but since we are copying all the existing attributes we don't need to do
that, as the relationships will already be set!

Fixes #24525

I introduced a bug in 2.3.0 as part of the dynamic task mapping work
that frequently made the mini scheduler fail for tasks involving
XComArgs.

The fix is to alter the logic in BaseOperator's deepcopy to not set the
`__instantiated` flag until all the other attributes are copied.

For background the `__instantiated` flag is use so that when you do
`task.some_attr = an_xcom_arg` the relationships are set appropriately,
but since we are copying all the existing attributes we don't need to do
that, as the relationships will already be set!
@ashb ashb requested review from kaxil and XD-DENG as code owners July 6, 2022 09:28
@ashb ashb requested review from uranusjr and ephraimbuddy July 6, 2022 09:30
Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

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

Nice one! Bisect to the rescue :)

@ephraimbuddy ephraimbuddy added this to the Airflow 2.3.3 milestone Jul 6, 2022
@ephraimbuddy ephraimbuddy added the type:bug-fix Changelog: Bug Fixes label Jul 6, 2022
@ashb
Copy link
Member Author

ashb commented Jul 6, 2022

Looks like a random failure of mysql?

@uranusjr
Copy link
Member

uranusjr commented Jul 6, 2022

Hmm since this is also related to copy behaviorr I kind of wonder if it is actually also the related to that other issue on MappedOperator. But we should be good now anyway after fixing them both now (there’s not a third kind of operator).

@ashb ashb merged commit c23b31c into apache:main Jul 6, 2022
@ashb ashb deleted the minischeduler-deepcopy-fix branch July 6, 2022 10:34
ephraimbuddy pushed a commit that referenced this pull request Jul 6, 2022
I introduced a bug in 2.3.0 as part of the dynamic task mapping work
that frequently made the mini scheduler fail for tasks involving
XComArgs.

The fix is to alter the logic in BaseOperator's deepcopy to not set the
`__instantiated` flag until all the other attributes are copied.

For background the `__instantiated` flag is use so that when you do
`task.some_attr = an_xcom_arg` the relationships are set appropriately,
but since we are copying all the existing attributes we don't need to do
that, as the relationships will already be set!

(cherry picked from commit c23b31c)
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.

mini-scheduler raises AttributeError: 'NoneType' object has no attribute 'keys'
5 participants