Repository navigation
fix(workflow): correlate activity and child workflow retries - #953
Conversation
Retry delay timers were created with the plain createTimer origin, and child workflow retry attempts carried no link to the first attempt, so history readers could not group the attempts of a retry. - Activity retry timers now carry the activityRetry origin with the chain's task execution ID. - Child workflow retry timers now carry the childWorkflowRetry origin with the first attempt's instance ID. - Child workflow retry attempts (2nd onward) set retryParentInstanceInfo to the first attempt's instance ID. Backwards compatible: no action is added, removed or reordered, and replay checks only action type and name, so histories recorded with the old origin replay unchanged. Activity retries replayed from a history with no task execution ID keep the createTimer origin. Signed-off-by: joshvanl <me@joshvanl.dev>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the retry-correlation metadata change.
No open issues 🎉
What changed in this PR
Adds retry correlation metadata so workflow history readers can group activity attempts, child workflow attempts, and their retry timers, while preserving replay compatibility with older histories.
Changes:
- Tags retry timers with the activity execution ID or first child workflow instance ID.
- Links subsequent child workflow attempts to the first attempt.
- Adds tests for correlation metadata, legacy-history replay, and unchanged user-created timer origins.
| File | Description |
|---|---|
test/unit/workflow/workflowRetry.test.ts |
Adds retry correlation and backward-compatible replay tests. |
src/workflow/engine/worker/protoHelpers.ts |
Supports retry timer origins and child retry parent metadata in action builders. |
src/workflow/engine/context/OrchestrationRuntimeContext.ts |
Supplies correlation identifiers when scheduling retry timers and child attempts. |
Review effort: Balanced
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #953 +/- ##
==========================================
+ Coverage 85.38% 85.48% +0.09%
==========================================
Files 160 160
Lines 5872 5884 +12
Branches 1220 1222 +2
==========================================
+ Hits 5014 5030 +16
+ Misses 669 664 -5
- Partials 189 190 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
WhitWaldo
left a comment
There was a problem hiding this comment.
Looks good to me - thank you!
Retry delay timers were created with the plain createTimer origin, and child workflow retry attempts carried no link to the first attempt, so history readers could not group the attempts of a retry.
Backwards compatible: no action is added, removed or reordered, and replay checks only action type and name, so histories recorded with the old origin replay unchanged. Activity retries replayed from a history with no task execution ID keep the createTimer origin.