Fix Kubernetes executor set wrong task status#31274
Merged
Merged
Conversation
3e022c4 to
03dc333
Compare
33807d8 to
b2d280f
Compare
ephraimbuddy
approved these changes
Jun 7, 2023
7c92d79 to
8006ae9
Compare
In the case of multiple schedulers and lots of tasks running If somehow schedulers restart and try to adopt pods in some cases, it sets the wrong task status. In this PR, I'm changing some checks so that if the pod status is non-terminal then set the task status Failed only if the pod event type is DELETED and POD_EXECUTOR_DONE_KEY is in the pod label
2a519d2 to
c8fe9e0
Compare
Member
Author
Tested it |
eladkal
pushed a commit
that referenced
this pull request
Jun 8, 2023
* Fix Kubernetes executor set wrong task status In the case of multiple schedulers and lots of tasks running If somehow schedulers restart and try to adopt pods in some cases, it sets the wrong task status. In this PR, I'm changing some checks so that if the pod status is non-terminal then set the task status Failed only if the pod event type is DELETED and POD_EXECUTOR_DONE_KEY is in the pod label * cleanup (cherry picked from commit dfbf529)
potiuk
pushed a commit
that referenced
this pull request
Jun 9, 2023
* Fix Kubernetes executor set wrong task status In the case of multiple schedulers and lots of tasks running If somehow schedulers restart and try to adopt pods in some cases, it sets the wrong task status. In this PR, I'm changing some checks so that if the pod status is non-terminal then set the task status Failed only if the pod event type is DELETED and POD_EXECUTOR_DONE_KEY is in the pod label * cleanup (cherry picked from commit dfbf529)
62 tasks
Contributor
|
#31198 issue fixed in this MR. |
Closed
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the case of multiple schedulers lots of tasks running
If schedulers restart a bit quickly some cases it sets the wrong task status.
In this PR, I'm changing some checks so that if the pod status is non-terminal
then set the task status to Failed only if the deletion_timestamp (metadata.deletion_timestamp) is set for the pod. This gets set when server receive the deletion request https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/object-meta/#ObjectMeta
Example screenshot before changes

Example screenshot after changes

^ 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.rstor{issue_number}.significant.rst, in newsfragments.