ScheduleToStart timeout for speculative WT on normal task queue#5146
Merged
alexshtin merged 8 commits intotemporalio:mainfrom Nov 30, 2023
Merged
ScheduleToStart timeout for speculative WT on normal task queue#5146alexshtin merged 8 commits intotemporalio:mainfrom
alexshtin merged 8 commits intotemporalio:mainfrom
Conversation
048594e to
a39f043
Compare
yycptt
approved these changes
Nov 29, 2023
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?
Add
ScheduleToStarttimeout for speculative WT on normal task queue.Why?
UpdateWorkflowExecutionAPI handler tries to add WT to matching directly. This call must be made outside of workflow lock and might fail (if matching is temporarily unavailable, for example). There is no good way to handle this error after lock was released. This is why I introduced thisScheduleToStarttimeout for speculative WT on the normal task queue. This timeout will ensure that WT will be eventually added to matching and workflow won't stuck.Also removed special flag which was used to skip transfer task creation when speculative WT is converted to normal before MS with speculative WT is persisted.
Both these speculative WT logic changes (timeout on normal and skip transfer task) are extracted to special
GenerateScheduleSpeculativeWorkflowTaskTasksmethod.How did you test it?
Added functional test.
Potential risks
Speculative WT times out once if there is no worker available.
Is hotfix candidate?
No.