Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Required wait update stage and polling improvements #251

Merged
merged 3 commits into from
May 21, 2024

Conversation

cretz
Copy link
Member

@cretz cretz commented May 21, 2024

What was changed

  • Created new WorkflowUpdateStartOptions as an extension of WorkflowUpdateOptions that has a required WaitForStage
  • Created new WorkflowUpdateStage enum representing its proto equivalent
  • Changed start update calls to require WorkflowUpdateStartOptions (:boom: breaking change)
  • Disallow None or Admitted wait stage on start, user must specify one
  • Updated start to continually start until stage reached or stage accepted, then poll if needed to reach complete
  • Added test to confirm workflow and update completed in same task

Checklist

  1. Closes [Feature Request] SDK clients should set a UpdateID on any update request even if the user did not specify one #198
  2. Closes [Feature Request] SDK should not return an update handle if the update has not reached the desired state #199
  3. Closes [Feature Request] Make StartUpdateAsync users aware that it's synchronous w/ worker.  #231

@cretz cretz requested a review from a team May 21, 2024 14:14
@cretz cretz force-pushed the update-updates branch from 7c56079 to 4849264 Compare May 21, 2024 16:26
@cretz cretz marked this pull request as ready for review May 21, 2024 16:26
{
throw new ArgumentException("WaitForStage is required to start workflow update");
}
else if (input.Options.WaitForStage == WorkflowUpdateStage.Admitted)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could just allow the server to reject this call? That way you don't need to update the SDK if the server adds support .

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing was mentioned at temporalio/sdk-python#521 (comment). I think we need to document what works and what doesn't here anyways, so that'll have to be updated anyways, and hopefully this becomes a default parameter in some durable-update future.

src/Temporalio/Client/WorkflowUpdateOptions.cs Outdated Show resolved Hide resolved
src/Temporalio/Client/WorkflowUpdateStage.cs Outdated Show resolved Hide resolved
@cretz cretz merged commit 618e878 into temporalio:main May 21, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants