What happens to a timer created with a deadline in the past?

Using the Go SDK, we had a situation where an activity gives back a timestamp that it wants to run again. If the timestamp is set we create new timer for timeWeWantToRun.Sub(workflow.Now(ctx))

What happens if the activity takes awhile to finish and passes back a timeWeWantToRun in the past? Experimentally it seems like the timer never fires / the selector hangs sleeping forever. But intuitively I thought it would just have auto-fired immediately when a selector runs. What part am I not understanding?

The timer that receives 0 or negative delay fires immediately without creating a server-side timer.

1 Like