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

[DSIP-29][Task] Deprecate DISPATCH status in task instance lifecycle #15882

Open
2 tasks done
Tracked by #14102
ruanwenjun opened this issue Apr 19, 2024 · 0 comments
Open
2 tasks done
Tracked by #14102
Assignees
Labels

Comments

@ruanwenjun
Copy link
Member

ruanwenjun commented Apr 19, 2024

Search before asking

  • I had searched in the DSIP and found no similar DSIP.

Motivation

Once a TaskInstance is triggered, the status will be changed follow: submit -> dispatch -> running.
Submit means the task instance is initialized, dispatch means the task has been dispatch to worker, running means the task is running in worker.

image

The dispatch status is useful in the history design, since dispatch is a async operation, but in the latest implementation, the dispatch operation is a sync operation, maintain a dispatch will bring some problems.

  1. When the task is in dispatch status, we cannot track it, we don't know whether the task is died since it done's initialize task instance log, we even donot know when the task will be executed.
  2. When we want to kill a task instance in worker, it's hard to do kill operation, since the task may in waiting queue or in thread pool queue.

If we deprecated the dispatch status, things will be easy, once a task has dispatch to worker we can directly set the task instance status to running. This means we will also deprecate the waiting queue in worker, since the waiting queue doesn't help to manage the task, it just make the task lifecycle more difficult and make the resource management difficult, we hope the waiting task is all manage by master, once the task has been sent to worker, it will get thread to execute.

Design Detail

  1. Remove the Dispatch status, once the task has been sent to worker then set task instance status to running.
image
  1. Deprecate the TaskExecuteThreadsFullPolicy in worker, the worker will reject the task once the worker thread pool is full.

Compatibility, Deprecation, and Migration Plan

This is compatibility, since the dispatch status will keep in code but only set it is depracated, will remove this after 3.3.0.

Test Plan

Tested by UT and E2E

Code of Conduct

@ruanwenjun ruanwenjun added Waiting for reply Waiting for reply DSIP and removed Waiting for reply Waiting for reply labels Apr 19, 2024
@ruanwenjun ruanwenjun changed the title [DSIP-][Task] Deprecate DISPATCH status in task instance lifecycle [DSIP-29][Task] Deprecate DISPATCH status in task instance lifecycle Apr 19, 2024
@ruanwenjun ruanwenjun self-assigned this Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant