Repository navigation
Conversation
A plugin that withdraws the output of failed workflow task attempts needs these History facts. Core already applies the events, so it hands them on.
…ok/v3/c2-history-facts # Conflicts: # crates/sdk-core/src/core_tests/workflow_task_interceptor.rs
A plugin withdraws a failed task's output at its next write to the same stream, which can come many completed tasks later. A superset of the failed tasks is always safe.
Owner
Author
|
Closing as stale. This layer is folded into the v5 tip, #209, and the upstream review uses one fresh PR instead. Plan: https://www.notion.so/4048fc567738814990b7c796ac28fe3f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
This PR adds two History facts to
WorkflowTaskCompletionInfo.previous_completedis the last completed task of the run. Its id comes from the poll response'sprevious_started_event_id(field 4), its attempt from that task'sWorkflowTaskScheduledevent, and its start time from itsWorkflowTaskStartedevent.failed_taskshas the started event ids of allWorkflowTaskFailedandWorkflowTaskTimedOutevents of the run, oldest first. A schedule-to-start timeout has no started event, so it is not there. A reset run lists the task that the reset failed.The machines collect both in the loop that already applies each event. The test history builder now sets
started_event_idon the failed and timed-out events, as the server does.Why?
A plugin that withdraws the output of failed task attempts needs these facts, and Core already has them. A failed task's output may be withdrawn many completed tasks later, so the list covers the whole run. A superset is always safe, and continue-as-new keeps it short.
How did you test it?
Link to a test plan if any -
Canned histories with a failed attempt, a start-to-close and a schedule-to-start timeout, an
UnhandledCommandrefusal and its retry, a reset, a failure before an earlier completion, and a sticky partial history after a timeout. The speculative-drop and heartbeat tests now also checkprevious_completed.