temporal icon indicating copy to clipboard operation
temporal copied to clipboard

Resetting open child workflow should not sent Terminated Failure to the parent

Open mfateev opened this issue 5 years ago • 1 comments

Expected Behavior

When a child is open resetting it should not be visible to its parent. So from the parent point of view, the reset child is still the same child and only its completion is reported.

Actual Behavior

The parent receives ChildWorkflowExecutionTerminated event instead.

Steps to Reproduce the Problem

  1. Take HelloChild Java Sample.
  2. Add Workflow.sleep(Duration.ofHours(1)) as the first line of the child workflow
  3. Start the sample
  4. Reset the child workflow using CLI command: tctl wf reset -w <childId> --event_id 4 --reason restart
  5. The parent receives the child terminated exception:
io.temporal.failure.ChildWorkflowFailure: workflowId='569e551a-f856-3c61-8686-788743138d21', runId='fee60ec8-8dad-40ac-b120-f121527cf38b', workflowType='GreetingChild', initiatedEventId=5, startedEventId=6, namespace='', retryState=RETRY_STATE_NON_RETRYABLE_FAILURE
	at java.lang.Thread.getStackTrace(Thread.java:1559)
	at io.temporal.internal.sync.CompletablePromiseImpl.throwFailure(CompletablePromiseImpl.java:136)
	at io.temporal.internal.sync.CompletablePromiseImpl.getImpl(CompletablePromiseImpl.java:95)
	at io.temporal.internal.sync.CompletablePromiseImpl.get(CompletablePromiseImpl.java:74)
	at io.temporal.samples.hello.HelloChild$GreetingWorkflowImpl.getGreeting(HelloChild.java:67)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at io.temporal.internal.sync.POJOWorkflowImplementationFactory$POJOWorkflowImplementation$RootWorkflowInboundCallsInterceptor.execute(POJOWorkflowImplementationFactory.java:289)
	at io.temporal.internal.sync.POJOWorkflowImplementationFactory$POJOWorkflowImplementation.execute(POJOWorkflowImplementationFactory.java:253)
	at io.temporal.internal.sync.WorkflowExecuteRunnable.run(WorkflowExecuteRunnable.java:52)
	at io.temporal.internal.sync.SyncWorkflow.lambda$start$0(SyncWorkflow.java:119)
	at io.temporal.internal.sync.CancellationScopeImpl.run(CancellationScopeImpl.java:104)
	at io.temporal.internal.sync.WorkflowThreadImpl$RunnableWrapper.run(WorkflowThreadImpl.java:107)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: io.temporal.failure.TerminatedFailure: null
	at io.temporal.internal.statemachines.ChildWorkflowStateMachine.notifyTerminated(ChildWorkflowStateMachine.java:303)
	at io.temporal.internal.statemachines.FixedTransitionAction.apply(FixedTransitionAction.java:45)
	at io.temporal.internal.statemachines.StateMachine.executeTransition(StateMachine.java:137)
	at io.temporal.internal.statemachines.StateMachine.handleHistoryEvent(StateMachine.java:91)
	at io.temporal.internal.statemachines.EntityStateMachineBase.handleEvent(EntityStateMachineBase.java:63)
	at io.temporal.internal.statemachines.WorkflowStateMachines.handleEventImpl(WorkflowStateMachines.java:210)
	at io.temporal.internal.statemachines.WorkflowStateMachines.handleEvent(WorkflowStateMachines.java:178)
	at io.temporal.internal.replay.ReplayWorkflowRunTaskHandler.handleEvent(ReplayWorkflowRunTaskHandler.java:140)
	at io.temporal.internal.replay.ReplayWorkflowRunTaskHandler.handleWorkflowTaskImpl(ReplayWorkflowRunTaskHandler.java:180)
	at io.temporal.internal.replay.ReplayWorkflowRunTaskHandler.handleWorkflowTask(ReplayWorkflowRunTaskHandler.java:150)
	at io.temporal.internal.replay.ReplayWorkflowTaskHandler.handleWorkflowTaskWithEmbeddedQuery(ReplayWorkflowTaskHandler.java:202)
	at io.temporal.internal.replay.ReplayWorkflowTaskHandler.handleWorkflowTask(ReplayWorkflowTaskHandler.java:112)
	at io.temporal.internal.worker.WorkflowWorker$TaskHandlerImpl.handle(WorkflowWorker.java:309)
	at io.temporal.internal.worker.WorkflowWorker$TaskHandlerImpl.handle(WorkflowWorker.java:275)
	at io.temporal.internal.worker.PollTaskExecutor.lambda$process$0(PollTaskExecutor.java:73)
	... 3 common frames omitted

Specifications

  • Version:
temporal-java-sdk[side-effect !]$ docker ps
CONTAINER ID        IMAGE                           COMMAND                  CREATED             STATUS              PORTS                                                                      NAMES
a0082ddf82b5        temporalio/web:0.29.0           "docker-entrypoint.s…"   11 days ago         Up 11 days          0.0.0.0:8088->8088/tcp                                                     docker_temporal-web_1
b48134a85124        temporalio/admin-tools:0.29.0   "tail -f /dev/null"      11 days ago         Up 11 days                                                                                     docker_temporal-admin-tools_1
eb70ad1ba9aa        temporalio/server:0.29.0        "/docker-entrypoint.…"   11 days ago         Up 11 days          6933-6935/tcp, 6939/tcp, 7234-7235/tcp, 7239/tcp, 0.0.0.0:7233->7233/tcp   docker_temporal_1
517cd71bd8a2        mysql:5.7                       "docker-entrypoint.s…"   11 days ago         Up 11 days          0.0.0.0:3306->3306/tcp, 33060/tcp                                          docker_mysql_1

mfateev avatar Sep 12 '20 19:09 mfateev

@mfateev https://github.com/temporalio/temporal/pull/2913 should address this issue.

elb3k avatar Jun 04 '22 17:06 elb3k