Exception handling for real-time workflows

Updated at:

Exception handling for real-time workflows operates at three levels: operator-level, event-level, and workflow-level. This topic describes the exception handling process in detail.

Operator-level exception handling

image

Policy

Description

Applicable scenarios

Automatic retry

When an operator fails, the system automatically retries it. You can configure the maximum retries (default is 3) and the retry interval, which supports both fixed intervals and exponential backoff.

Transient errors, such as network timeouts or temporary container unavailability.

Timeout control

If an operator exceeds the configured timeout (default is 300 seconds), the system forcibly terminates it and marks it as failed.

Scenarios like blocked operator logic or timeouts during large file processing.

Event-level exception handling

Dataset write failure handling mechanism:
If an operator successfully processes data but fails to write it to the target dataset (due to issues such as connection errors, schema mismatches, or primary key conflicts), the system applies the event-level exception handling policy. It automatically archives the data to a dirty data file and records an exception log. The workflow continues to run, commits the current offset, and proceeds to consume subsequent events. To find details about the write failure, navigate to Develop > task O&M > instance O&M > real-time instance and check the runtime log for the corresponding real-time instance.

Outputs of event-level exceptions:

  • Dirty data file: The system writes dirty data to a CSV file that includes the generation time, error message, and error cause. For more information, see .

  • Alert triggering: If the failure rate exceeds the configured threshold, the system triggers an alert.

Workflow-level exception handling

Exception scenario

System behavior

Recovery method

Listener crash

The Session monitoring service detects a lost Listener heartbeat and automatically restarts the Listener.

The system restores the consumption offset from the last successful Checkpoint, and automatically replays events in the uncommit set.

Insufficient Credit balance

The workflow task stops consuming from Kafka but is not terminated.

After you add Credits, consumption automatically resumes from the offset of the last successful Checkpoint.

Operator container OOM or crash

Kubernetes automatically restarts the container (RestartPolicy=Always).

After the restart, the Router re-enlists the container. After a timeout, the orchestration layer retries in-flight events on other containers.

Object storage unavailable

A Context overflow causes write failures, leading to operator execution errors.

This triggers continuous operator-level retries. If the system cannot process the event after all retries, it treats the event as dirty data.

Kafka connection lost

The Listener automatically reconnects, using the built-in reconnection mechanism of the kafka consumer.

After a successful reconnection, consumption resumes from the current offset. If the connection is not re-established before the timeout, the system marks the Listener as failed and restarts it.

Checkpoint and recovery

Item

Description

Checkpoint content

Only the start offset is saved (serialized). The window between the start and end offsets has a size of 1,000 events.

Checkpoint frequency

Checkpoints run every 60 seconds based on a built-in, non-configurable policy.

Checkpoint storage

Checkpoints are persisted to a database .

Recovery mode

Resume from checkpoint: Restores the start offset, end offset, and uncommit set from the last successful Checkpoint. The system reprocesses events in the uncommit set.

Startup mode

  • Clean start: Starts consumption from a specified point: earliest, latest, or a specific timestamp offset.

  • Resumed start: Resumes from the last successful Checkpoint.

Idempotency guarantee

Because recovery from a Checkpoint can cause events to be consumed more than once, operators and dataset writes must be idempotent (for example, by using a primary key upsert). For non-idempotent scenarios, your application is responsible for handling deduplication.