-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
AIP-72: Handling up_for_retry
task instance states for AirflowTaskTimeout
and AirflowException
#44981
Conversation
@@ -80,7 +80,7 @@ class TaskInstanceState(str, Enum): | |||
SUCCESS = TerminalTIState.SUCCESS # Task completed | |||
RESTARTING = IntermediateTIState.RESTARTING # External request to restart (e.g. cleared when running) | |||
FAILED = TerminalTIState.FAILED # Task errored out | |||
UP_FOR_RETRY = IntermediateTIState.UP_FOR_RETRY # Task failed but has retries left | |||
UP_FOR_RETRY = TerminalTIState.UP_FOR_RETRY # Task failed but has retries left |
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.
This should be IntermediateTIState
, i.e. the task will be "retried" as opposed to success, failed, skipped etc -- where it TI is completed
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.
I think in DM we discussed UPSTREAM_FAILED
should be TerminalTIState
not UP_FOR_RETRY
@@ -39,6 +39,7 @@ class TerminalTIState(str, Enum): | |||
FAILED = "failed" | |||
SKIPPED = "skipped" # A user can raise a AirflowSkipException from a task & it will be marked as skipped | |||
REMOVED = "removed" | |||
UP_FOR_RETRY = "up_for_retry" # We do not need to do anything actionable for this state, hence it is a terminal state. |
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.
"terminal state" means the task is done; up for retry does not really feel like a terminal state.... since it's going to be retried....
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.
this highlights an ambiguity / conflict. the TI-try is done, but the TI is not
Thanks @kaxil and @dstandish. I got confused here with similar names "up_for_retry" and "upstream_failed". Will take a look and redo it tomorrow. Thanks |
Closing this PR as it is easier to create a new one |
Only last 2 commits are relevant.
Dependent on #44977 and hence on #44954.
Handling the case of
up_for_retry
from the task SDK.This exception can be thrown in multiple cases, two valid examples are:
AirflowTaskTimeout
exception:Should be marked with
up_for_retry
AirflowException
Example: If we are unable to render the pod template for K8s while using K8sExecutor with Airflow.
Key changes:
up_for_retry
state intoTerminalTIState
as it is a terminal state and on hitting this state, anything additional work apart from marking it to that state needn't be done.^ 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.