Confusing error with invalid argument: DeterministicRunnerImpl.checkClosed

I have a load test workflow that exponentially creates child workflows (following the same patterns as the rabbit test in the Temporal blog). The parent workflow completes successfully, but has a stacktrace of the following.

3 INVALID_ARGUMENT: java.lang.Error: closed at
io.temporal.internal.sync.DeterministicRunnerImpl.checkClosed( at 
io.temporal.internal.sync.DeterministicRunnerImpl.stackTrace( at 
io.temporal.internal.sync.SyncWorkflow.query( at 
io.temporal.internal.replay.ReplayWorkflowExecutor.query( at 
io.temporal.internal.replay.ReplayWorkflowRunTaskHandler.handleQueryWorkflowTask( at 
io.temporal.internal.replay.ReplayWorkflowTaskHandler.handleQueryOnlyWorkflowTask( at 
io.temporal.internal.replay.ReplayWorkflowTaskHandler.handleWorkflowTask( at 
io.temporal.internal.worker.WorkflowWorker$TaskHandlerImpl.handle( at 
io.temporal.internal.worker.WorkflowWorker$TaskHandlerImpl.handle( at 
io.temporal.internal.worker.PollTaskExecutor.lambda$process$0( at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker( at 
java.base/java.util.concurrent.ThreadPoolExecutor$ at 

Looking at the history, nothing jumps out at me, so I don’t know if this is an error I should care about. It sounds worrisome, and I don’t see anything in my worfklow code that is non-deterministic: scenario.kt · GitHub

edit: I’ve also included the history export in the gist.

This trace is from a “__stack_trace” query request. As stack trace is not meaningful for a closed workflow the request failed. So it is benign. I filed an issue to not log an exception in this case.