Repository navigation
Conversation
A Local Activity runs again with the same Activity id and with attempt 1 when its Workflow Task is retried, and nothing in `activity.Info` tells the two executions apart or orders them. `Info.workflow_task` has the started event id, the attempt and the started time of that task, which Core sends for a Local Activity.
Owner
Author
|
Closed in favour of temporalio#2127 |
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.
This PR adds
activity.Info.workflow_taskfor a Local Activity.It is the Workflow Task in which the Worker dispatched this execution, as a
WorkflowTaskAttemptwithstarted_event_id,attemptandstarted_time. It isNonefor every other Activity. Core already sends the value inActivityTask.Start.workflow_task(temporalio/sdk-rust#1703), and this PR only maps it.Why. A Local Activity runs inside a Workflow Task. When that task fails or times out, the retried task runs the same Local Activity again, with the same Activity id and with
attemptback at 1. Nothing inactivity.Infotells the two executions apart or orders them. A Local Activity that has an effect outside Temporal needs that. Streams is the first user. A Local Activity that appends to a Stream writes as a Producer whose epoch is its Workflow Task, so the Store refuses a late write of the failed task, and a reader can tell the two copies apart.The three fields.
started_event_idorders the Workflow Tasks of a run.attemptorders the attempts of one task.started_timetells a reused started event id apart. The server can drop a speculative task, and the next task then gets the same event id.Open for review. Is this the right shape for every author of an Activity, or should
activity.Infogive one opaque value that is unique and ordered across the executions of a Local Activity in a run?