Skip to content

Duplicate concurrent workflow - hangs on completion #456

@smax48

Description

@smax48

Expected Behavior

I start 2 workflows (one by one) with the same workflowId and WorkflowIdReusePolicy.WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE option.
I use execute method to start exection.

First workflow is still running when I start the second - so the second should just becomes a "proxy" for the first one and should return the same result without starting a new wf instance.

Then I try to wait for CompletableFuture and get the result.
Pseudo-code for illustration:

f1 = WorkflowClient.execute(..., options)
f2 = WorkflowClient.execute(..., options)
result1 = f1.get()
result2 = f2.get()

The behaviour is very different when I use Test Environment and real docker containers for Temporal.
With "real" Temporal all works as expected.
I expect that in the test environment it works the same way.

Actual Behaviour

With Test Environment the second f2.get() call hangs forever.

If the first workflow is fully completed before starting the second, all works OK.

Steps to Reproduce the Problem

I have a test (implemented in Kotlin) that fully reproduces the described issue. See the attached file.
DuplicateWorkflowIdTest.kt.zip

Specifications

  • Version: Java SDK 1.0.7, Temporal 1.8.2
  • Platform: Java SDK 1.0.7, Kotlin

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtest serverRelated to the test server

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions