Skip to content

Workflows using createTimer with (short) duration resolve the timer immediately #1735

@ddelbondio

Description

@ddelbondio

Expected Behavior

When using createTimer with a duration, I would expect the code to actually wait the supplied duration

Actual Behavior

Depending on the situation, the timer is determined to already be expired and the code continues without any wait time.

Steps to Reproduce the Problem

Simply doing this in a workflow doesn't trigger any wait at all for me locally.

        for (int i = 0; i < total; i++) {
            ctx.createTimer(Duration.ofMillis(500)).await();
        }

this produces following events, where it practically never waits for 500ms at all:

02:08:01.552 INFO  [io.da.du.orchestration] (pool-16-thread-1) Get orchestration factory for sampleSleep version 
02:08:02.004 INFO  [io.da.du.orchestration] (pool-16-thread-1) Get orchestration factory for sampleSleep version 
02:08:02.015 INFO  [io.da.du.orchestration] (pool-16-thread-1) Get orchestration factory for sampleSleep version 
02:08:02.028 INFO  [io.da.du.orchestration] (pool-16-thread-1) Get orchestration factory for sampleSleep version 
02:08:02.038 INFO  [io.da.du.orchestration] (pool-16-thread-1) Get orchestration factory for sampleSleep version 
02:08:02.053 INFO  [io.da.du.orchestration] (pool-16-thread-1) Get orchestration factory for sampleSleep version 
02:08:02.062 INFO  [io.da.du.orchestration] (pool-16-thread-1) Get orchestration factory for sampleSleep version 
02:08:02.073 INFO  [io.da.du.orchestration] (pool-16-thread-1) Get orchestration factory for sampleSleep version 
02:08:02.083 INFO  [io.da.du.orchestration] (pool-16-thread-1) Get orchestration factory for sampleSleep version 
02:08:02.095 INFO  [io.da.du.orchestration] (pool-16-thread-1) Get orchestration factory for sampleSleep version 
02:08:02.110 INFO  [io.da.du.orchestration] (pool-16-thread-1) Get orchestration factory for sampleSleep version 

Release Note

RELEASE NOTE:

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions