InternalWorkflowTaskException java.lang.Error: closed when executing await & then signaling to wake up

We are seeing workflows sporadically but frequently enough throw an error & go into continueAsNew at this line.
Any insight on what the root cause might be?

{
“message”: “java.lang.Error: closed”,
“source”: “JavaSDK”,
“stackTrace”: “io.temporal.internal.replay.ReplayWorkflowRunTaskHandler.handleWorkflowTaskImpl(ReplayWorkflowRunTaskHandler.java:197)\nio.temporal.internal.replay.ReplayWorkflowRunTaskHandler.handleWorkflowTask(ReplayWorkflowRunTaskHandler.java:150)\nio.temporal.internal.replay.ReplayWorkflowTaskHandler.handleWorkflowTaskWithEmbeddedQuery(ReplayWorkflowTaskHandler.java:201)\nio.temporal.internal.replay.ReplayWorkflowTaskHandler.handleWorkflowTask(ReplayWorkflowTaskHandler.java:114)\nio.temporal.internal.worker.WorkflowWorker$TaskHandlerImpl.handle(WorkflowWorker.java:319)\nio.temporal.internal.worker.WorkflowWorker$TaskHandlerImpl.handle(WorkflowWorker.java:279)\nio.temporal.internal.worker.PollTaskExecutor.lambda$process$0(PollTaskExecutor.java:73)\njava.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\njava.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\njava.base/java.lang.Thread.run(Thread.java:829)\n”,
“cause”: {
“message”: “closed”,
“source”: “JavaSDK”,
“stackTrace”: “io.temporal.internal.sync.DeterministicRunnerImpl.checkClosed(DeterministicRunnerImpl.java:431)\nio.temporal.internal.sync.DeterministicRunnerImpl.executeInWorkflowThread(DeterministicRunnerImpl.java:477)\nio.temporal.internal.sync.SyncWorkflowContext.lambda$newTimer$d7d857c6$1(SyncWorkflowContext.java:547)\nio.temporal.internal.replay.ReplayWorkflowContextImpl.handleTimerCallback(ReplayWorkflowContextImpl.java:290)\nio.temporal.internal.replay.ReplayWorkflowContextImpl.lambda$newTimer$114ed502$1(ReplayWorkflowContextImpl.java:282)\nio.temporal.internal.statemachines.WorkflowStateMachines.lambda$newTimer$4b87b190$1(WorkflowStateMachines.java:473)\nio.temporal.internal.statemachines.TimerStateMachine.notifyCompletion(TimerStateMachine.java:159)\nio.temporal.internal.statemachines.FixedTransitionAction.apply(FixedTransitionAction.java:45)\nio.temporal.internal.statemachines.StateMachine.executeTransition(StateMachine.java:137)\nio.temporal.internal.statemachines.StateMachine.handleHistoryEvent(StateMachine.java:91)\nio.temporal.internal.statemachines.EntityStateMachineBase.handleEvent(EntityStateMachineBase.java:63)\nio.temporal.internal.statemachines.WorkflowStateMachines.handleEventImpl(WorkflowStateMachines.java:210)\nio.temporal.internal.statemachines.WorkflowStateMachines.handleEvent(WorkflowStateMachines.java:178)\nio.temporal.internal.replay.ReplayWorkflowRunTaskHandler.handleEvent(ReplayWorkflowRunTaskHandler.java:140)\nio.temporal.internal.replay.ReplayWorkflowRunTaskHandler.handleWorkflowTaskImpl(ReplayWorkflowRunTaskHandler.java:180)\nio.temporal.internal.replay.ReplayWorkflowRunTaskHandler.handleWorkflowTask(ReplayWorkflowRunTaskHandler.java:150)\nio.temporal.internal.replay.ReplayWorkflowTaskHandler.handleWorkflowTaskWithEmbeddedQuery(ReplayWorkflowTaskHandler.java:201)\nio.temporal.internal.replay.ReplayWorkflowTaskHandler.handleWorkflowTask(ReplayWorkflowTaskHandler.java:114)\nio.temporal.internal.worker.WorkflowWorker$TaskHandlerImpl.handle(WorkflowWorker.java:319)\nio.temporal.internal.worker.WorkflowWorker$TaskHandlerImpl.handle(WorkflowWorker.java:279)\nio.temporal.internal.worker.PollTaskExecutor.lambda$process$0(PollTaskExecutor.java:73)\njava.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\njava.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\njava.base/java.lang.Thread.run(Thread.java:829)\n”,
“cause”: null,
“applicationFailureInfo”: {
“type”: “java.lang.Error”,
“nonRetryable”: false,
“details”: null
},
“failureInfo”: “applicationFailureInfo”
},
“applicationFailureInfo”: {
“type”: “io.temporal.internal.replay.InternalWorkflowTaskException”,
“nonRetryable”: false,
“details”: null
},
“failureInfo”: “applicationFailureInfo”
}

Are you able to reproduce this problem against the latest version of the Java SDK?

No we are still on 1.3.0, I see this is 1.5.0 Remove Error throwing from DeterministicRunner#executeInWorkflowThread is case if execution is closed by Spikhalskiy · Pull Request #817 · temporalio/sdk-java · GitHub will try that out & see if the error goes away

1 Like