You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- The `paused` property is intentionally **not available** in the `@worker_task` decorator. It can only be controlled via environment variables, allowing operators to pause/resume workers at runtime without code changes or redeployment.
35
35
- The `lease_extend_enabled` parameter is accepted but **not currently implemented**. For lease extension, use manual `TaskInProgress` returns (see below).
36
+
- The `register_task_def` parameter automatically registers task definitions with JSON Schema (draft-07) generated from Python type hints. Does not overwrite existing definitions.
When `register_task_def=True`, the worker automatically registers its task definition with Conductor on startup, including JSON schemas generated from type hints.
When workers start, they log their resolved configuration in a compact single-line format:
@@ -988,6 +1067,7 @@ The built-in `MetricsCollector` is implemented as an event listener that respond
988
1067
-`TaskExecutionStarted(task_type, task_id, worker_id, workflow_instance_id)` - When task execution begins
989
1068
-`TaskExecutionCompleted(task_type, task_id, worker_id, workflow_instance_id, duration_ms, output_size_bytes)` - When task completes (includes actual async execution time)
990
1069
-`TaskExecutionFailure(task_type, task_id, worker_id, workflow_instance_id, cause, duration_ms)` - When task fails
1070
+
-`TaskUpdateFailure(task_type, task_id, worker_id, workflow_instance_id, cause, retry_count, task_result)` - **Critical!** When task update fails after all retries (4 attempts with 10s/20s/30s backoff)
991
1071
992
1072
**Event Properties:**
993
1073
- All events are dataclasses with type hints
@@ -1021,6 +1101,59 @@ handler = TaskHandler(
1021
1101
)
1022
1102
```
1023
1103
1104
+
### Update Retry Logic & Failure Handling
1105
+
1106
+
**Critical: Task updates are retried with exponential backoff**
1107
+
1108
+
Both TaskRunner and AsyncTaskRunner implement robust retry logic for task updates:
1109
+
1110
+
**Retry Configuration:**
1111
+
-**4 attempts total** (0, 1, 2, 3)
1112
+
-**Exponential backoff**: 10s, 20s, 30s between retries
1113
+
-**Idempotent**: Safe to retry updates
1114
+
-**Event on final failure**: `TaskUpdateFailure` published
1115
+
1116
+
**Why This Matters:**
1117
+
Task updates are **critical** - if a worker executes a task successfully but fails to update Conductor, the task result is lost. The retry logic ensures maximum reliability.
0 commit comments