cadence-client icon indicating copy to clipboard operation
cadence-client copied to clipboard

Reset workflows contains child workflow cause non-deterministic error

Open yux0 opened this issue 5 years ago • 3 comments

Describe the bug Reset workflows contains child workflow cause non-deterministic error if the child workflow id is not set.

https://github.com/uber-go/cadence-client/blob/5cc879bc3a9b2258ca569b5cb971231d9de0ff9b/internal/internal_event_handlers.go#L357 To Reproduce Is the issue reproducible?

  • Yes

Steps to reproduce the behavior:

  1. Implement a parent workflow contains a child wf
  2. Do not set the workflow id in the child wf execution context
  3. Start the wf and wait for it to finish
  4. Reset the finished wf

Expected behavior The workflow should be able to reset if there is no pending child wf.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context From this line: https://github.com/uber-go/cadence-client/blob/5cc879bc3a9b2258ca569b5cb971231d9de0ff9b/internal/internal_event_handlers.go#L357. The default child wf is the run id + sequence id. However, after the wf is reset, the run id will be updated and caused the non-deterministic error

yux0 avatar Jun 09 '20 18:06 yux0

Directly change this could be a non-backward compatible change. One thing we can think of is to add a side effect for this generated child workflow id

yux0 avatar Jun 09 '20 20:06 yux0

My understanding is: reset doesn't support workflow with child at all. It is kind of next steps for rest

vancexu avatar Jun 17 '20 18:06 vancexu

It doesn't support if there is pending child workflows. With finished child workflows, I think it should support

yux0 avatar Jun 17 '20 22:06 yux0