Principle:Apache Dolphinscheduler Task Lifecycle Event Tracking
| Knowledge Sources | |
|---|---|
| Domains | Distributed_Systems, Event_Processing |
| Last Updated | 2026-02-10 00:00 GMT |
Overview
An event-driven task lifecycle tracking pattern where workers report state transitions via typed lifecycle events to the master through RPC callbacks, enabling reactive workflow DAG progression.
Description
The Task Lifecycle Event Tracking principle defines how task state changes are communicated from workers back to the master server. Each significant lifecycle transition (dispatched, running, success, failure, killed, paused, context change) generates a typed event object that is sent to the master via the ITaskExecutorEventListener RPC interface. The master processes these events to update the workflow DAG state, trigger downstream tasks, or finalize the workflow.
This event-driven approach decouples task execution from workflow orchestration, allowing the worker to focus on task execution while the master reactively manages the DAG based on incoming events.
Usage
Lifecycle events are automatically sent by the PhysicalTaskExecutor during task execution. The master implements ITaskExecutorEventListener to receive and process these events.
Theoretical Basis
The event tracking follows the Observer Pattern in a distributed context:
- Subject: Worker's PhysicalTaskExecutor generates lifecycle events
- Observer: Master's ITaskExecutorEventListener implementation processes events
- Channel: RPC framework transports events between nodes
// Event types and their triggers
TaskExecutorDispatchedLifecycleEvent // task accepted by worker
TaskExecutorStartedLifecycleEvent // execution begun
TaskExecutorSuccessLifecycleEvent // completed successfully
TaskExecutorFailedLifecycleEvent // execution failed
TaskExecutorKilledLifecycleEvent // killed by user/system
TaskExecutorPausedLifecycleEvent // paused by user
TaskExecutorRuntimeContextChangedLifecycleEvent // progress/log update