Repository navigation
Conversation
2 of 3 tasks
Owner
Author
|
Closing as stale. This layer is folded into the v5 tip, #365, and the upstream review uses a fresh series 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.
This PR writes Workflow Records through one Local Activity per call.
What changed?
create_stream,publishandclosein a Workflow each run one Local Activity (__temporal_streams_create,__temporal_streams_append,__temporal_streams_close). The plugin registers the three activities.Writes to one Stream run in order. A failed write raises at the
await, or fails the Workflow Task for the_nowaitforms.publishreturns the last offset.The run drains its writes before it returns or continues as new, and closes its Streams at the end of the chain.
A write keeps the Workflow Task in its Producer epoch, so a Local Activity retry in the same task dedupes, and a later task withdraws what a failed task wrote. A retry run withdraws the failed run on its first write to each Stream. A create names the run chain as the Stream owner.
The Workflow call buffer, the Activation flush, the
durable_writesoptions and the unusedon_workflow_activation_completeplugin hook are gone.The crate pin moves to s20
f3c74d24, and thesdk-coresubmodule moves to Brook c632ba79d6. Together they drop the Workflow write buffer and the Workflow Task hooks, and add the run's task history to a Local Activity task. The bridge's debug test extension loses its hook counters, and so doestests/worker/test_extension.py.S110: every Local Activity write (the Workflow writes and a user Local Activity's writer) sends the run's last completed Workflow Task and its failed tasks, from the new
activity.Info.workflow_task.previous_started_event_idandfailed_tasks. So the run's next write to a Stream withdraws what Local Activities wrote there in tasks that never completed. TheSupersededdocstring states the limit: a Stream that the run never writes again keeps those Records.Why?
A Local Activity gives each write a recorded result, so replay does not write again and a write error reaches the caller. The run buffer and its flush on Workflow Task completion are no longer needed.
How did you test it?
New tests cover a write to a closed Stream and to a missing Stream, ordered concurrent publishes with a Replayer that shows no write on replay, a retried append that goes in once, a user Local Activity that runs again after a failed Workflow Task and withdraws its first attempt, and a failed task's Local Activity that the retry task skips, whose Records the next write withdraws. The streams suite passes on the memory and Redis backends, and
poe lintis green.🤖 Generated with Claude Code