Skip to content

Conversation

@samarabbas
Copy link
Contributor

@samarabbas samarabbas commented May 11, 2020

What changed?
Added FirstExecutionRunId to request for Terminate and RequestCancel API. Client can pass in FirstExecutionRunId to allow Terminate and RequestCancel across runs when workflow execution does continue as new.

Updated the transfer queue processor logic of workflow close processing to also include RunId of started child workflow to allow terminate to work across runs of child execution.

Updated history engine processing of Terminate and RequestCancel to also compare the FirstExecutionId passed on the request with information in mutable state.

Added FirstExecutionRunID to mutable state which gets persisted in DB. Now we don't rely on workflow execution started event for this information.

Why?

Whenever child workflow is terminated due to Terminate policy specified by parent, history service compares both workflow and run Ids. This comparison won't cause child to be terminated if it does continue as new.

Fixes #364.

How did you test it?
Added new integration test: TestChildWorkflowWithContinueAsNewParentTerminate.

Potential risks
No risks.

Whenever child workflow is terminated due to Terminate policy specified
by parent, history service compares both workflow and run id.  This
comparison won't cause child to be terminated if it does continue as
new.
Updated the transfer queue processor logic of workflow close processing
to also include parent execution info when terminating all outstanding
child executions.
Updated history engine processing of Terminate to try and load current
execution when terminate is triggered due to terminate policy of child
and try to terminate the child if parent information matches.
@samarabbas samarabbas requested a review from mfateev May 11, 2020 02:38
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.

ParentClosePolicy ignores children that called continue as new

2 participants