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

Handle CanceledAfterStarted in CanceledEvent #1027

Conversation

Quinn-With-Two-Ns
Copy link
Contributor

User reported this issue where I believe they tried to cancel a workflow that had a child workflow and it resulted in the parent workflow getting stuck panicing on invalid state transition on the ChildWorkflowExecutionCanceled because it didn't expect it to be in CanceledAfterStarted. I don't see why we would treat CanceledAfterInitiated differently than CanceledAfterStarted so I allowed the state transition.

Previously the SDK would consider this an invalid state transition and panic, now the SDK handles it as a canceled child workflow.

@Quinn-With-Two-Ns Quinn-With-Two-Ns requested a review from a team as a code owner February 1, 2023 23:51
@@ -1161,6 +1161,57 @@ func testReplayWorkflowCancelChildWorkflowUnusualOrdering(ctx Context) error {
return nil
}

func (s *internalWorkerTestSuite) TestReplayWorkflowHistory_ChildWorkflowCancellation_WhenWorkflowCanceled() {
Copy link
Member

Choose a reason for hiding this comment

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

Can you replicate the failure in an integration test? Seems straightforward enough to wait for a child workflow to start and then cancel its parent and confirm the parent panicked/WFT-failed before this fix.

(sorry, I just trust integration tests much more than manual history creation)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No fair point I'll make an integration test, I will say this manual history is basically what the customers history looked like

@Quinn-With-Two-Ns Quinn-With-Two-Ns merged commit c6405d6 into temporalio:master Feb 2, 2023
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