Repository navigation
Fix queries buffered during Continue-As-New - #3166
Closed
danikhan-oai wants to merge 2 commits into
Closed
danikhan-oai wants to merge 2 commits into
danikhan-oai wants to merge 2 commits into
Conversation
Treat Continue-As-New as terminal when deciding whether to schedule a new workflow task on the current run. This lets the old history commit before buffered queries dispatch. Register each query future before dispatch so an immediate worker response can resolve it. Add a regression test that buffers a query during Continue-As-New, responds during dispatch, and verifies the query stays on the closed run.
|
|
1 similar comment
|
|
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.
A strongly consistent query can be buffered while a workflow task completes Continue-As-New. The test server can then try to schedule another workflow task on the closed run. The completion fails with
NOT_FOUND: workflow execution already completed, and the query waits until its deadline.Use
isTerminalState()for the workflow-task rescheduling guard so Continue-As-New commits the old run's history before buffered queries dispatch. Register each buffered query result future beforesendQueryTaskso an immediate response can find it.The regression test uses a latch to confirm the query is buffered before Continue-As-New completes. It responds synchronously during dispatch and verifies that the query remains bound to the original run, receives its committed close event, and does not prevent the new run from starting.
Testing
3fb41a5a28b94fe7a150105901b626ba259fa050withNOT_FOUND: workflow execution already completed.NOT_FOUND: Unknown query id.temporal-test-servermodule suite: 98 passed, 1 existing ignored test tracked bytaskTimeoutWillRescheduleTheTaskOnTheGlobalListon the test server is flaky #2333, 0 failed.git diff --checkpassed.:temporal-test-server:installDistdistribution.The source test results above apply to commit
1257ea83d43916fee9ce071fd6b9317d5bf1c077. The follow-up commit only adds the required changelog entry, which passed the local placement check.The complete repository test suite and native image build were not run.