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-73] Add dolphinscheduler-task-executor module to unify the task execution logic #16619

Open
2 tasks done
Tracked by #14102
ruanwenjun opened this issue Sep 14, 2024 · 0 comments
Open
2 tasks done
Tracked by #14102
Assignees

Comments

@ruanwenjun
Copy link
Member

ruanwenjun commented Sep 14, 2024

Search before asking

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

Motivation

Right now, we have two similar task execution process.

  • Logic task execution: The task which been executed in master container.
  • Physical task execution: The task which been executed in worker container.

Most of these two execution process are similar, except some thread model.
The problem is we have two similar code, once we want change the task execution runtime, we should change both of these.
This DSIP is aim to unify these.

Design Detail

I hope to add a new module dolphinscheduler-task-executor module which will provide a TaskEngine used to responsible for task execution.

TaskEngine

The high-level architecture may look like below
image

The WorkflowEngine will use TaskExecutorClient to communicate with TaskEngine. TaskEngine provides interface to response for the control of TaskExecutor, and TaskEngine can also send runtime event to master.

There are some components in the TaskEngine

TaskExecutor

The TaskExecutor represent a runtime task in TaskEngine.
image

Each TaskExecutor contains a EventBus to store the event belongs to the task executor, all operation of the task executor should be transform to TaskExecutorLifecycleEvent and be fired by async. The event will be fired by ordered, we use this to avoid concurrency problems with operations.

TaskExecutorRepository

Used to store TaskExecutor in runtime, once the TaskExecutor execute finished, then will removed from TaskExecutorRepository.

TaskExecutorContainerDelegator

The delegator for TaskExecutorContainer, there are two kinds of TaskExecutorContainer.

The TaskExecutorContainer will contains some TaskExecutorWorker, each TaskExecutorWorker will be fired by a single thread, so the ratio between worker and thread is 1:1.

But not all task will block a thread in its whole lifecycle. So there are two kinds of TaskExecutorContainer.

SharedThreadTaskExecutorContainer

One TaskExecutorWorker can be assigned multiple tasks.

image

ExclusiveThreadTaskExecutorContainer

One TaskExecutorWorker can only assigned one task.

image

TaskExecutorEventBusCoordinator

The TaskExecutorEventBusCoordinator used to assign/unassign the TaskExecutor to TaskExecutorEventBusFireWorker

Lifecycle of TaskExecutor

image image

Compatibility, Deprecation, and Migration Plan

Compatibility with previous version.

Test Plan

Test by IT, E2E. Will add new IT case.

Code of Conduct

@ruanwenjun ruanwenjun added Waiting for reply Waiting for reply DSIP labels Sep 14, 2024
@ruanwenjun ruanwenjun self-assigned this Sep 14, 2024
@ruanwenjun ruanwenjun added priority:high and removed Waiting for reply Waiting for reply labels Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant