Skip to content

ScheduleToStart timeout for speculative WT on normal task queue#5146

Merged
alexshtin merged 8 commits intotemporalio:mainfrom
alexshtin:fix/spec-wt-push-matching
Nov 30, 2023
Merged

ScheduleToStart timeout for speculative WT on normal task queue#5146
alexshtin merged 8 commits intotemporalio:mainfrom
alexshtin:fix/spec-wt-push-matching

Conversation

@alexshtin
Copy link
Contributor

@alexshtin alexshtin commented Nov 22, 2023

What changed?
Add ScheduleToStart timeout for speculative WT on normal task queue.

Why?
UpdateWorkflowExecution API 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 this ScheduleToStart timeout 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 GenerateScheduleSpeculativeWorkflowTaskTasks method.

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.

@alexshtin alexshtin requested a review from a team as a code owner November 22, 2023 00:55
@alexshtin alexshtin requested a review from yycptt November 22, 2023 20:29
@alexshtin alexshtin force-pushed the fix/spec-wt-push-matching branch from 048594e to a39f043 Compare November 23, 2023 05:27
@alexshtin alexshtin changed the title Add ScheduleToStart timeout for speculative WT on normal task queue ScheduleToStart timeout for speculative WT on normal task queue Nov 24, 2023
@alexshtin alexshtin enabled auto-merge (squash) November 30, 2023 03:03
@alexshtin alexshtin merged commit c6aef53 into temporalio:main Nov 30, 2023
@alexshtin alexshtin deleted the fix/spec-wt-push-matching branch November 30, 2023 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants