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

Return StartOutcome from Workflow Start #6795

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

stephanos
Copy link
Contributor

@stephanos stephanos commented Nov 11, 2024

ℹ️ Depends on #6795

What changed?

Introducing a new StartOutcome type. It signals the kind of start that was performed.

I considered various other options (like sentinel error types and adding a new field to the proto), but then decided on this.

Why?

This is needed for making Terminate-Existing work, since there it's important to distinguish between "deduped" and "reused".

See #6783

How did you test it?

Potential risks

Documentation

Is hotfix candidate?

@stephanos stephanos changed the title Uws starttype Return StartOutcome from Workflow Start Nov 11, 2024
Comment on lines -162 to -170
startOpResp := &historyservice.ExecuteMultiOperationResponse_Response{
Response: &historyservice.ExecuteMultiOperationResponse_Response_StartWorkflow{
StartWorkflow: &historyservice.StartWorkflowExecutionResponse{
RunId: currentWorkflowLease.GetContext().GetWorkflowKey().RunID,
Started: false,
},
},
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Inlined below

return nil, startOutcome, newMultiOpError(err,
serviceerror.NewUnavailable("Workflow could not be started as it is already running"))
case startworkflow.StartDeduped:
panic("unreachable")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will be used in the follow-up PR.

@stephanos stephanos marked this pull request as ready for review November 11, 2024 03:00
@stephanos stephanos requested a review from a team as a code owner November 11, 2024 03:00
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.

1 participant