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

AIP-72: Semantically correct the TI state handling in supervisor #45291

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

amoghrajesh
Copy link
Contributor

We transition states to a terminal state in supervisor under wait(). We do it when the task has finished running and has reached a "non direct" state. Direct states are ones which need some information to transition into. For example, the reschedule state needs "reschedule date".

Code that handles this: https://github.com/apache/airflow/blob/main/task_sdk/src/airflow/sdk/execution_time/supervisor.py#L524-L527

However, a more semantically correct way to transition into a terminal state would be to check if "hey, have we already transitioned our TI into some state, if not, let me do it - to success or failed or something like that."

This PR corrects some of these things semantically so that it reflects the intent.
Checks for if self.final_state not in STATES_SENT_DIRECTLY


^ 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.

@amoghrajesh amoghrajesh requested review from ashb and kaxil December 30, 2024 13:18
@amoghrajesh amoghrajesh changed the title Semantically correct the TI state handling in supervisor AIP-72: Semantically correct the TI state handling in supervisor Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant