-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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 external_executor_id being overwritten #37784
Fix external_executor_id being overwritten #37784
Conversation
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.
Hmmm. I am not sure, but isn't that actually overwritten potentially when there is a task adoption by another executor in another scheduler? I think this is the purpose of overriding it when the task is running. To cover the case where one executor got the task queued, but then it failed before the executor managed to change it to running and then another executor - in the other scheduler instance adopted it and actually managed to change state to running.
At least that would be my guess here. Are we sure that it's ok to leave the executor id "as is" in this case?
I might be wrong of course, but that sounds like a case where overriding it would make sense (but it's more of "I am not sure" that "I know"). |
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.
Ah sorry. No - should be fine (stupid me) I missed the None
override only.
(cherry picked from commit 0232ad0)
Hi, I'm not sure if this fix applies to the Kubernetes Pod Operator one, after setting it as a |
Currently, if you watch the taskinstance db table when you run a dag, you will notice that there is an external_executor_id value assigned when the TaskInstance state is QUEUED, but it gets overwritten with None when the TaskInstance state hits RUNNING. This change will only overwrite that field if another is provided.
Added some asserts to an existing unit test and added some new tests to verify behavior and prevent regression.
@jedcunningham - this is the bug you helped me repro
NOTE: This PR is blocking #37786 and must be merged first.
^ 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.