Repository navigation
Conversation
A client that holds only a StreamRef could not end its read when the run ended. The ref now carries its owning Workflow (crate s8), and for_ref(end_with_run=True) uses it as for_handle does. A read that ends with the run now polls in short steps and counts idle time across them.
The crate gets Workflow refs from lang only, and the plugin dropped the owner when it encoded a call or built a run-end close.
A ref that Python wrote must read in TypeScript and .NET, so its JSON keys are the proto JSON names. Snake case keys still decode for one release.
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.
What changed?
This PR adds
end_with_runtostreams.for_ref(client, ref).StreamRefnow carries its owning Workflow, asworkflow_idandfirst_execution_run_id(S30, crate s8813f9d12, proto fields 2 and 3, also in the WIT copy and the bindings).workflow_stream(),create_workflow_stream()andfor_handle()set them.create_stream()and Activity refs leave them empty.for_ref(end_with_run=True)builds the Workflow handle from them and ends the read asfor_handledoes, also during a wait for the create. It raisesValueErrorfor a ref with no owner. Old refs with onlyidstill decode. On the payload converter,StreamRefuses the proto JSON names (id,workflowId,firstExecutionRunId), so a ref that Python wrote reads in TypeScript and .NET. Snake case keys still decode for one release. The plugin also carries the owner on every ref that it sends to the crate.A read that ends with the run now polls in steps of 2 s and checks the run in between. Before, it checked the run only after a long poll of up to 5 minutes with no Records. The idle time still counts from the last Record, across the steps.
Why?
The harness found that a client with only a
StreamRefcould not end its read when the owning run ended.How did you test it?
pytest tests/contrib/streamson the memory Store and on Redis. The new tests cover:ValueErrorfor a ref with no owner;id, and an old ref with snake case keys;temporal.api.streamservice.v1.StreamRef;BufferWorkflowCallsrequests.Full
poe lintand the full suite pass at this layer, excepttest_envconfig, which reads a config file on this host.