-
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 failed
TI state for AirflowTaskTerminated
#44977
Merged
amoghrajesh
merged 15 commits into
apache:main
from
astronomer:AIP72-taskterminated-or-afexception
Dec 19, 2024
Merged
AIP-72: Handling failed
TI state for AirflowTaskTerminated
#44977
amoghrajesh
merged 15 commits into
apache:main
from
astronomer:AIP72-taskterminated-or-afexception
Dec 19, 2024
Conversation
This file contains 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
amoghrajesh
added
area:task-execution-interface-aip72
AIP-72: Task Execution Interface (TEI) aka Task SDK
area:task-sdk
labels
Dec 17, 2024
amoghrajesh
requested review from
ephraimbuddy and
pierrejeambrun
as code owners
December 17, 2024 07:35
10 tasks
amoghrajesh
changed the title
AIP-72: Handling failed TI state for AirflowException & AirflowTaskTerminated
AIP-72: Handling Dec 17, 2024
failed
TI state for AirflowException
& AirflowTaskTerminated
amoghrajesh
commented
Dec 17, 2024
amoghrajesh
changed the title
AIP-72: Handling
AIP-72: Handling Dec 17, 2024
failed
TI state for AirflowException
& AirflowTaskTerminated
failed
TI state for AirflowTaskTerminated
Co-authored-by: Kaxil Naik <[email protected]>
Co-authored-by: Kaxil Naik <[email protected]>
kaxil
approved these changes
Dec 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area:task-execution-interface-aip72
AIP-72: Task Execution Interface (TEI) aka Task SDK
area:task-sdk
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.
related: #44414
This is an addition to #44954 and is dependent on it.
Only last commit is relevant cb493ee
We do not have to handle the case of external task state updates specifically in task_runner because public UI APIs will directly do that job - core APIs. So there is no scenario when one of these exceptions are thrown due to this:
airflow/task_sdk/src/airflow/sdk/execution_time/supervisor.py
Lines 608 to 615 in 83da311
We check with the database for the state with the heartbeat and if ever there is a different state, other than running:
airflow/airflow/api_fastapi/execution_api/routes/task_instances.py
Lines 210 to 218 in 83da311
But, if this state is ever hit, we should just mark the TI as failed. There are UTs https://github.com/apache/airflow/compare/main...astronomer:airflow:AIP72-taskterminated-or-afexception?expand=1#diff-413c3c59636a3c7b41b8bb822827d18a959778d0b6331532e0db175c829dbfd2R342-R397 which handle this portion to check if it fails or not.
^ 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.