[Bug?] Workflow proceeds without signal – Workflow.await() skipped unexpectedly

:red_question_mark: [Bug?] Workflow proceeds without signal – Workflow.await() skipped unexpectedly

Hi all,
I’m seeing unexpected behavior in my self-hosted Temporal setup (Java SDK + Spring Boot). Here’s the situation:

  • I have a workflow with multiple HTTP calls, then a Workflow.await() that waits for a signal to proceed.

  • Signal handler just sets a flag proceed = true;

  • Code pattern:

    proceed = false;
    Workflow.await(() -> proceed);
    LOGGER.info("Signal received: {}", signalData);
    return true;
    
  • I then bombarded Temporal by starting 50+ instances of this workflow (all with unique workflow IDs).

  • Issue: Some workflows proceeded past the await() without ever receiving a signal.

    • There’s no WorkflowExecutionSignaled event visible in the Temporal Web UI for these instances.
    • Signal handler was not invoked, confirmed via logging.

Environment:

  • Java SDK
  • Temporal Server: Self-hosted (official temporal Docker)
  • All workflows use the same task queue, and I’m using one or two workers.
  • No global/static variables involved, proceed is a workflow field.
  • Live reload/devtools is off.

Question:

  • Has anyone else seen Workflow.await() getting bypassed under load without a signal?
  • Could this be related to internal caching, zombie runs, or race conditions in the worker?
  • Any suggestions on how to debug or reproduce this cleanly?

Thanks in advance!

I’ve never heard about such an issue. Are you using Spring to initialize workflow objects, by any chance? I’ve seen cases where the same workflow object was shared by multiple workflows, causing all sorts of undefined behavior.

Here is my sample code for initialising workflow. But surprisingly I am not at all passing the signal to any of the running workflow.
DynamicWorkflow workflow = workflowClient.newWorkflowStub(
DynamicWorkflow.class,
WorkflowOptions.newBuilder().setWorkflowId(workflowId).setTaskQueue(taskQueue).build()
);
Ideal behaviour

But getting

You can clearly see the signal is skipped

How do you register your workflow implementation with the worker?

This is via, spring initializer

   @Bean
    public Worker worker(WorkerFactory factory, WorkflowActivitiesImpl activities) {
        Worker worker = factory.newWorker(taskQueue);
        worker.registerWorkflowImplementationTypes(DynamicWorkflowImpl.class);
        worker.registerActivitiesImplementations(activities);
        factory.start();
        return worker;
    }

I don’t see anything obvious. If you can share a reproduction we’ll take a look.

Hi everyone,
Just wanted to give an update regarding the issue I had raised earlier. It turns out the problem was on my side — specifically a bug in my workflow code (There was race condition). After fixing it, everything is working as expected now.

Thanks to everyone who took the time to look into it and offer suggestions. Really appreciate the support!

1 Like