Repository navigation
Conversation
Activations and Workflow Tasks are not one to one, so the crate keeps each run's calls and writes them once per task in before_complete. Closes wait for an accepted completion and go out in the background, so they never hold the run's next task.
… time. A failure that the server retries, or a cron run, goes on with the Run Chain, so lang's chain_continues keeps its auto close out. A task with no started time fails its flush, since its epoch could collide with a dropped speculative task. Durable flushes write and wait on their own connection.
A Local Activity heartbeat completion comes at 80% of the task timeout, so the fixed 200 ms margin ate all the time left and failed the flush. The margin is now at most a quarter of the time left, and a mock-Worker test covers the heartbeat flush end to end.
Lang may cancel DrainCloses at shutdown, and the tracker then stayed closed. The tests also check that calls after a drain, or after a dropped one, still answer.
Owner
Author
|
Closing as stale. This layer is folded into the v5 tip, #41, 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 the Workflow path. Lang calls
BufferWorkflowCallsat the end of each Activation. The crate'sWorkflowTaskInterceptorwrites the run's creates and appends inbefore_complete, as the run's Producerwf:<run id>with the task's epoch,previous_completed_taskandfailed_tasks. It sends the closes in the background afterafter_completeaccepts. A close fromauto_closegoes out only when the completion closes the run. The flush splits at the batch limit and drops oversize Records and Records for a Stream that someone else closed, withstream_records_dropped.durable_writesrunsWAIT.DrainCloseswaits for the closes at shutdown.Why?
Activations and Workflow Tasks are not one to one, so the data goes out once per task. Closes wait for acceptance, so a refused completion never closes a Stream. Core holds the run's next task until
after_completereturns, so the close retries run in the background.How did you test it?
STREAMS_REQUIRE=redis cargo test -p temporalio-streams --test workflowdrives the buffer call and the hooks as Core calls them, on standalone and cluster Redis.