Skip to content

AIP-72: Improve Supervisor and Task Instance State Validation#44405

Merged
kaxil merged 1 commit intoapache:mainfrom
astronomer:handle-already-running-task
Nov 27, 2024
Merged

AIP-72: Improve Supervisor and Task Instance State Validation#44405
kaxil merged 1 commit intoapache:mainfrom
astronomer:handle-already-running-task

Conversation

@kaxil
Copy link
Copy Markdown
Member

@kaxil kaxil commented Nov 27, 2024

This commit adds test that Supervisor prevents starting a Task Instance that is already running. Also updated test_ti_update_state_conflict_if_not_queued to use parameterized states, covering all non-queued Task Instance states.

This is part of my efforts to port LocalTaskJob tests to Supervisor: #44356.

This ports over TestLocalTaskJob.test_localtaskjob_double_trigger


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

This commit adds test that Supervisor prevents starting a Task Instance that is already running. Also updated `test_ti_update_state_conflict_if_not_queued` to use parameterized states, covering all non-queued Task Instance states.

This is part of my efforts to port LocalTaskJob tests to Supervisor: apache#44356.

This ports over `TestLocalTaskJob.test_localtaskjob_double_trigger`
@kaxil kaxil added the area:task-execution-interface-aip72 AIP-72: Task Execution Interface (TEI) aka Task SDK label Nov 27, 2024
@kaxil kaxil requested a review from ashb November 27, 2024 01:35
Copy link
Copy Markdown
Contributor

@amoghrajesh amoghrajesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kaxil kaxil merged commit b1a44b4 into apache:main Nov 27, 2024
@kaxil kaxil deleted the handle-already-running-task branch November 27, 2024 12:13
@ashb
Copy link
Copy Markdown
Member

ashb commented Nov 27, 2024

Oh, it might be worth extending this to check that the task code itself is never actually invoked? I'm not quite sure how we might do that across the subprocess though

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

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

4 participants